Commit Graph

56 Commits

Author SHA1 Message Date
Joshua Yanovski
b44e442325 Miscellaneous performance improvements. 2020-08-06 13:40:35 +02:00
Joshua Yanovski
d4d4956e92 Merge remote-tracking branch 'origin/master' into sharp/small-fixes 2020-08-02 20:56:54 +02:00
Marcel Märtens
7f97baca70 switch to auth that doesn't use agent 2020-07-31 01:05:01 +02:00
Marcel Märtens
0d5e61c4b6 update auth to newest version 2020-07-29 19:28:22 +02:00
Joshua Yanovski
56da06f7a3 Merge remote-tracking branch 'origin/master' into sharp/small-fixes 2020-07-29 18:56:52 +02:00
Joshua Yanovski
cf74d55f2e Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts 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.
2020-07-29 18:29:52 +02:00
Marcel Märtens
96cde882ef update auth to the newest version and remove useless dep 2020-07-29 00:05:23 +02:00
Joshua Yanovski
13b6d4d534 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).
2020-07-28 10:55:48 +02:00
Joshua Yanovski
6332cbe006 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes 2020-07-12 18:47:00 +02:00
Songtronix
5b57072064 fix: use correct specs(-idvs) versions
related to torvus
2020-07-09 19:46:30 +02:00
Joshua Yanovski
db1401a691 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes 2020-07-07 19:34:17 +02:00
Marcel Märtens
c212de00c2 updated dependencies and fixed stuff
- replace serde_derive by feature of serde
   incl. source code modifications to compile
 - reduce futures-timer to "2.0" to be same as async_std
 - update notify
 - removed mio, bincode and lz4 compress in common as networking is now in own crate
   btw there is a better lz4 compress crate, which is newer than 2017
 - update prometheus to 0.9
 - can't update uvth yet due to usues
 - hashbrown to 7.2 to only need a single version
 - libsqlite3 update
 - image didn't change as there is a problem with `image 0.23`
 - switch old directories with newer directories-next
 - no num upgrade as we still depend on num 0.2 anyways
 - rodio and cpal upgrade
 - const-tewaker update
 - dispatch (untested) update
 - git2 update
 - iterations update
2020-07-07 09:43:49 +02:00
Imbris
8d39f27458 Upgrade hashbrown 2020-07-06 03:15:06 -04:00
Imbris
c2d6d00b00 point to github specs to access PairedStorage type, fix Loadout sync spam 2020-07-06 01:56:02 -04:00
Joshua Yanovski
4e02024670 Merge remote-tracking branch 'origin/master' into sharp/small-fixes 2020-07-04 16:17:40 +02:00
Marcel Märtens
77c90b2c7c doing a simple 1:1 swap out network coding
this is the part which prob has less Merge conflics and is easy to rebase
the next commit will have prob alot of merge conflics
followed by a fmt commit
2020-07-03 13:11:31 +02:00
Joshua Yanovski
618a18c998 Adding shadows, greedy meshing, and more. 2020-07-02 22:10:22 +02:00
Marcel Märtens
9485b45e70 switch to tracing stlye and enhance logs with usefull information
- Updated CHANGELOG
- reduce dependencies
- found out that we have alot of duplicate coding... alot...
2020-06-22 09:53:15 +02:00
Kevin Glasson
589254e4ab Convert all other veloren crates to use tracing
- Completely removed both `log` and `pretty_env_logger` and replaced
with `tracing` and `tracing_subscriber` where necessary.

- Converted all `log::info!(...)` et al. statements to just use the
shorthand macro i.e. `info!`. This was mostly to make renaming easier.
2020-06-21 23:19:41 +08:00
Marcel Märtens
0e59ee901e dependency reduction:
- authc no longer uses reqwest
 - image only supports PNG
 - replace routille with tiny_http
 - several other dependencies
 - cargo upgrade
 - following improvement was measured on R7 1700X:
   before:
    - cargo build: 3076.73s user / 4:45 total / 589 dependencies
    - cargo test: 6118.38s user / 7:30 total / 959 dependencies
   after:
    - cargo build: 2680.54s user / 4:05 total / 480 dependencies
    - cargo test: 5351.81s user / 7:04 total / 791 dependencies
 - added xMAC94x to CODEOWNERS for Cargo.toml, he will protect them from now on and hit people with evil looks ;)
2020-06-11 20:55:34 +02:00
Joshua Yanovski
f8376fd5dc Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes 2020-05-21 17:53:57 +02:00
Marcel Märtens
ec03c4518a Change the version number to 0.6 2020-05-16 00:50:40 +02:00
Joshua Yanovski
8414987e58 WIP -- lighting changes and soft shadows. 2020-04-09 02:38:40 +02:00
Joshua Yanovski
88342640c6 Merge branch 'sharp/map-colors' into sharp/small-fixes 2020-04-02 04:49:20 +02:00
Joshua Yanovski
32b2c99109 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.
2020-04-02 02:46:36 +02:00
Imbris
b3791a2b4e Upgrade vek version so that it actually uses the patch 2020-03-30 19:44:51 -04:00
Acrimon
bc39b78173 Rebased. 2020-03-08 23:02:15 +01:00
Acrimon
08b4cc5fc3 Update auth to use new hashing scheme. 2020-03-08 22:56:34 +01:00
Acrimon
7db0ff0b8c Update chat-cli to work properly.
Update reqwest to 0.10.0
2020-03-08 22:54:15 +01:00
Imbris
8ef1251dc2 Add warning prompt for untrusted auth servers, move some auth code into 2020-03-08 22:51:37 +01:00
Marcel Märtens
e960c2233b Change the version number to 0.5 2020-01-31 17:26:45 +01:00
Joshua Barretto
e391d6e4fd Added no-assets feature to common 2020-01-27 22:41:30 +00:00
Joshua Yanovski
1358f1dffa Changes to worldgen, adding more sedmient etc. 2020-01-23 18:18:14 +01:00
Imbris
d341073a44 Upgrade to specs 0.15.1 2019-12-20 22:48:14 -05:00
soruh
6dfa146484 Mitgated RUSTSEC-2019-0014 by updating noise and
disabling its default features, specifically `image`,
which had the vulnerability.
2019-11-05 11:14:39 +00:00
Joshua Yanovski
8ae2692b6e Allow canceling chunk generation.
Currently we only do this when no players are in range of the chunk.  We
also send the first client who posted the chunk a message indicating
that it's canceled, the hope being that this will be a performance win
in single player mode since you don't have to wait three seconds to
realize that the server won't generate the chunk for you.

We now check an atomic flag for every column sample in a chunk.  We
could probably do this less frequently, but since it's a relaxed load it
has essentially no performance impact on Intel architectures.
2019-10-16 11:39:41 +00:00
Marcel Märtens
20c520a044 Change the version number to 0.4 2019-10-10 15:48:01 +02:00
timokoesters
c4879307af
Update to github vek repo 2019-08-26 13:12:45 +02:00
timokoesters
a715a84ea7
Implement unstoppable rolling 2019-08-26 13:12:42 +02:00
Acrimon
b4a46f3e6e Finished switch to hashbrown. 2019-08-11 22:38:28 +02:00
Acrimon
22f318833c Migrate client to hashbrown. 2019-08-11 21:54:20 +02:00
Piotr Korgól
d3f2ca69a4 Change the version number to 0.3 2019-08-04 13:53:59 +02:00
Dominik Broński
f644b6ab89 Revert "Merge branch 'imbris/upgrade_specs' into 'master'"
This reverts merge request !375
2019-08-01 23:32:33 +00:00
Imbris
5f56657f6c Upgrade specs to 0.15 2019-08-01 18:09:13 -04:00
Acrimon
ee49ebe807 Update rand, log and scan_fmt 2019-07-29 13:42:26 +00:00
timokoesters
5aa864ee58
Update most dependencies 2019-07-28 22:47:23 +02:00
Acrimon
a36c049b06 Resolve Forests discussion. 2019-07-12 20:13:35 +02:00
Acrimon
b4f2cd1547 Resolve discussion from Timo. 2019-07-12 19:56:40 +02:00
Acrimon
20ac81a986 Fixed some misses. 2019-07-12 20:51:22 +02:00
Joshua Barretto
92f2d36b0c Optimised sub-terrain chonk storage, fixed hash chunk bug, altered terrain base 2019-06-05 20:52:51 +01:00