Commit Graph

575 Commits

Author SHA1 Message Date
Joshua Yanovski
a428a3ebba 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).
2020-08-02 20:41:51 +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
Joshua Yanovski
ad18ce9399 Fix continent scale hack. 2020-07-28 13:21:09 +02:00
Joshua Yanovski
36b1cb074f Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
2020-07-28 12:11:40 +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
7d56ba31b4 Merge remote-tracking branch 'origin/master' into sharp/small-fixes 2020-07-27 13:16:27 +02:00
Monty Marz
31cfc05123 lots of things
animation fixes by slipped
new cultist item
settings option for loading screen tips
loot table adjustments
2020-07-23 12:10:13 +00:00
Joshua Yanovski
2101113b46 Higher detail LOD. 2020-07-18 18:55:25 +02:00
Joshua Yanovski
add2cfae04 Revert some irrelevant stuff. 2020-07-16 01:57:39 +02:00
Joshua Barretto
8d6b442193 Crafting 2020-07-14 20:11:39 +00:00
Ben Wallis
a9be045cb8 Fixed suppressed clippy warnings for #587 - useless_conversion 2020-07-13 20:57:13 +01:00
Joshua Yanovski
be438657c3 Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
2020-07-12 18:28:08 +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
Marcel
e19d170b61 Merge branch 'imbris/smaller-fixes' into 'master'
Stop spamming loadout, Update specs

See merge request veloren/veloren!1165
2020-07-06 09:50:46 +00:00
Imbris
8d39f27458 Upgrade hashbrown 2020-07-06 03:15:06 -04:00
Snowram
d6da1f0e75 post-quad rewrite fixup 2020-07-06 06:07:29 +00:00
Joshua Barretto
43f75f2f54 Removed bomb timeout 2020-07-05 16:15:51 +01:00
Joshua Barretto
fd39ee97bc Added training dummies 2020-07-05 16:15:51 +01:00
Joshua Barretto
2f6a618d5a Added bombs, throwable items, more block kinds, weaker explosions 2020-07-05 16:15:48 +01:00
jshipsey
d8fff8833e quadlow spawn in world, continued adjustments 2020-07-05 09:38:14 -04:00
Joshua Yanovski
4e02024670 Merge remote-tracking branch 'origin/master' into sharp/small-fixes 2020-07-04 16:17:40 +02:00
Joshua Yanovski
618a18c998 Adding shadows, greedy meshing, and more. 2020-07-02 22:10:22 +02:00
Marcel Märtens
6535fa5744 fix various clippy issues 2020-07-01 00:37:06 +02:00
Shane Handley
304e06cbce Fix clippy warnings after toolchain update 2020-06-23 16:52:04 +10:00
Marcel Märtens
15fc5787e4 switch log behavior for env variable and removed gfx spam by default 2020-06-22 16:49:40 +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
Ben Wallis
6da7a11d33 Fixed suppressed clippy warnings for #587 - clone_on_copy 2020-06-18 22:25:48 +01:00
Imbris
26e53409d8 Merge branch 'xvar/clippy-globally-suppress-option_map_unit_fn' into 'master'
Globally suppressed clippy lint option_map_unit_fn for #587

See merge request veloren/veloren!1071
2020-06-14 16:48:07 +00:00
Ben Wallis
c1c968f479 Globally suppressed clippy lint option_map_unit_fn for #587 2020-06-14 16:48:07 +00:00
Imbris
fb47115695 Merge branch 'xvar/clippy-fixes-redundant_closure_found' into 'master'
Fixed suppressed clippy warnings for #587 - redundant_closure

See merge request veloren/veloren!1065
2020-06-14 16:33:04 +00:00
Ben Wallis
4d6c553b1b Fixed suppressed clippy warnings for #587 - redundant_closure 2020-06-12 20:47:22 +01:00
Ben Wallis
8ed2109bcf Fixed suppressed clippy warnings for #587 - collapsible_if 2020-06-12 20:34:54 +01: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
Ben Wallis
950c62efc6 Suppressed all existing clippy warnings in preparation for fixes as part of #587 2020-06-10 22:01:42 +01:00
Monty Marz
b34da9b07b More item drops 2020-06-03 17:59:09 +00:00
CapsizeGlimmer
78a06550d0 Only NPCs speak when hit. Farm animal alignment changed from NPC to Tame 2020-05-27 13:49:18 +02:00
Joshua Barretto
786665eac4 Merge branch 'sharp/deterministic-civsim' into 'master'
Make civsim and sites deterministic.

See merge request veloren/veloren!1009
2020-05-26 19:22:48 +00:00
Treeco
4c41cc1050 Changed SEED_SKIP to 0 2020-05-21 21:59:59 +01:00
Joshua Yanovski
eaea83fe6a Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes 2020-05-21 22:47:07 +02:00
Joshua Yanovski
2f89b863e0 Merge branch 'treeco/new-map' into 'master'
Changed default map and seed, lowered site counts

See merge request veloren/veloren!992
2020-05-21 20:46:54 +00:00
Joshua Yanovski
34427373ef 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.
2020-05-21 21:43:54 +02:00
Joshua Yanovski
2670184954 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.
2020-05-21 21:20:01 +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 Barretto
db59a3ca3d Merge branch 'small-fixes' into 'master'
Dungeon Bosses

See merge request veloren/veloren!994
2020-05-15 19:07:11 +00:00
Joshua Barretto
fff4021777 Better spawn town 2020-05-15 19:26:09 +01:00
Joshua Barretto
ba80f7c872 Fixed square staircases in dungeons 2020-05-15 18:34:05 +01:00
Joshua Barretto
93de58252e More interesting dungeon features 2020-05-15 17:22:51 +01:00