Commit Graph

13627 Commits

Author SHA1 Message Date
Joshua Barretto
539c482cff Capped out NPC movement at higher dts 2023-04-09 19:25:53 +01:00
IsseW
c026b4d20a travelers say where they're going 2023-04-09 19:25:53 +01:00
IsseW
9be6c7b527 Pathing between sites. 2023-04-09 19:25:53 +01:00
Joshua Barretto
feaaaa9a25 Added initial impl of factions 2023-04-09 19:25:53 +01:00
IsseW
ca02b5e97c cleaner entity creation 2023-04-09 19:25:52 +01:00
IsseW
e7798f2a4e use world alt for pathing 2023-04-09 19:25:52 +01:00
Joshua Barretto
6397e283b2 Added world settings 2023-04-09 19:25:52 +01:00
Joshua Barretto
bccbbfa3b9 Fixed up broken time 2023-04-09 19:25:52 +01:00
Joshua Barretto
e08f7d4fa9 Added blacksmith 2023-04-09 19:25:52 +01:00
IsseW
afd9ea5462 site pathing 2023-04-09 19:25:52 +01:00
Joshua Barretto
f40cfb4ac3 Made farmers sell food 2023-04-09 19:25:52 +01:00
Joshua Barretto
e204789ce9 Persist TimeOfDay with rtsim 2023-04-09 19:25:52 +01:00
IsseW
64c56f544d randomly walk around town 2023-04-09 19:25:52 +01:00
Joshua Barretto
ee048ad5a2 Made NPCs talk and trade 2023-04-09 19:25:52 +01:00
Joshua Barretto
ff7478eb01 Factored out NPC AI 2023-04-09 19:25:52 +01:00
IsseW
21f9bcb8e2 added professions, and loadouts 2023-04-09 19:25:52 +01:00
IsseW
ac0e62df8e tp_npc command 2023-04-09 19:25:52 +01:00
Joshua Barretto
587996abb7 Correctly scale glider physics 2023-04-09 19:25:52 +01:00
Joshua Barretto
df63e41a23 Clamp NPCs to surface 2023-04-09 19:25:51 +01:00
Joshua Barretto
558dd99fd3 Added basic rtsim NPC simulation, rtsim controller support 2023-04-09 19:25:51 +01:00
Joshua Barretto
8ff438bb5b Smol animals 2023-04-09 19:25:51 +01:00
Joshua Barretto
f140a94dc6 Fixed scaled terrain collisions 2023-04-09 19:25:51 +01:00
Joshua Barretto
c856f2625c Added rtsim sites 2023-04-09 19:25:51 +01:00
Joshua Barretto
1dc7518200 Added rtsim entity unload hook 2023-04-09 19:25:51 +01:00
Joshua Barretto
f349e99cfb Better camera at smaller scales 2023-04-09 19:25:51 +01:00
Joshua Barretto
87a6143375 Began adding rtsim2 NPCs, scale command 2023-04-09 19:25:51 +01:00
Joshua Barretto
9d3dadfaba Make resource depletion an rtsim rule 2023-04-09 19:25:51 +01:00
Joshua Barretto
0b06eaec6f Use MessagePack for more compact rtsim state persistence 2023-04-09 19:25:51 +01:00
Joshua Barretto
a421c1239d Use BufReader/BufWriter for rtsim2 operations 2023-04-09 19:25:51 +01:00
Joshua Barretto
c168ff2f9b Added rtsim saving, chunk resources, chunk resource depletion 2023-04-09 19:25:51 +01:00
Joshua Barretto
d5e324bded Fixed bad comment 2023-04-09 19:25:51 +01:00
Joshua Barretto
0cafafdaa7 Began integrating rtsim2 into server 2023-04-09 19:25:51 +01:00
Joshua Barretto
ca80d831ce Added rtsim crate, added initial persistence model 2023-04-09 19:25:51 +01:00
Isse
1ea69156da Merge branch 'fix_salamander_tail_front_offset' into 'master'
fix_salamander tail_front offset

See merge request veloren/veloren!3863
2023-04-09 10:46:57 +00:00
flo
1cca6cfa74 fix_salamander tail_front offset 2023-04-09 10:46:57 +00:00
Imbris
54c39c03f7 Merge branch 'imbris/pixel-perfection-v2' into 'master'
Move image scaling into the UI shaders rather than precomputing it on the CPU

Closes #257

See merge request veloren/veloren!3573
2023-04-08 07:06:19 +00:00
Imbris
5881e44e61 Address review on 3573 2023-04-08 02:19:14 -04:00
Imbris
2a9a63a60e Clippy fixes 2023-04-08 00:51:50 -04:00
Imbris
132ce72246 Fix some comments that were mis-formatted by rustfmt
and remove TODO that is now documented as a review comment
2023-04-08 00:51:50 -04:00
Imbris
07d3242b26 Update changelog 2023-04-08 00:51:49 -04:00
Imbris
9cdfb6a4aa Resolve some remaining TODOs for ui image processing changes
* Explicitly assert that neither of the requested dimensions for an
  image are 0. (I think this used to fail later on anyway)
* Don't show the UI alpha premultiply pass in GPU timings in the HUD
  debug info display since it only very transiently appears (since this
  doesn't run every frame).
2023-04-08 00:29:29 -04:00
Imbris
7205d4c275 Remove extra performance debugging code 2023-04-08 00:28:32 -04:00
Imbris
63096b2042 Complete GPU based alpha premultiplication impl and make the CPU version
even faster.

* GPU based version started in previous commit, but this fixes errors
  and bugs and gets it actually compiling and running.
* Add a way to batch together images to use the same render pass for GPU
  premultiplication if they all target the same texture.
* Pending premultiplication uploads are automatically done when calling
  `Drawer::third_pass`.
* `fast-srgb8` dep removed, we no longer convert to `f32`s to do the
  premultiplication. Two `[u16; 256]` tables are combined to compute the
  alpa premultiplied color within the same error bounds used by the
  `fast-srgb8` crate. We also no longer use explicit simd.
* Remove explicit lifetimes from `PlayState::render` since `&self` and
  `Drawer<'_>` don't need to have the same lifetime.
* Fix existing bug where invalidated cache entries were never set to
  valid when reusing them.
* `prepare_graphic` now runs some heuristics to determine whether
  premultiplication should be executed CPU side or GPU side and then
  returns a bool indicating if GPU premultiplication is needed.
2023-04-08 00:28:31 -04:00
Imbris
efd932c71e Progress on GPU premultiplication.
* General progress in setting up code paths to support GPU
  premultiplication.
* Created `PremultiplyUpload` type to represent an initiated image
  upload where the premultiply pass needs to be ran to complete it.
* Converted from compute pass to render pass since current limitations
  make it difficult to write directly to a srgb image from a compute
  shader.
* Replace `CachedDetails::Immutable` with keeping track of the
  parameters used to create the texture (i.e. the border color).
* Create `TextureRequirements`, `TextureParamters`, and `CacheKey` types
  to encode parameters that go into texture creation and image caching
  and to determine when the space in texture memory should be reused
  when replacing a graphic.
* Add custom texture creation logic for the UI textures since those need
  certain usage combinations.
2023-04-08 00:28:31 -04:00
Imbris
1d51aae3b2 Start attempt to premultiply alpha on the GPU. 2023-04-08 00:28:31 -04:00
Imbris
7538b04348 Operate on 4 pixels at a time when premultiplying alpha to speed things up a little. 2023-04-08 00:28:31 -04:00
Imbris
f62c2cde70 Use fast-srgb8 crate to efficiently convert between non-linear srgb u8 and
linear f32 values for performing alpha premultiplication on the CPU.
2023-04-08 00:28:31 -04:00
Imbris
eb6d16b02c Rename draw_graphic -> prepare_graphic since it is no longer always
specifically rendering an image at the provided dimensions. Start
working on alpha premultipication which is necessary for being able to
properly sample colors on the GPU with bilinear filtering. Various
tweaks to comments and misc changes.
2023-04-08 00:28:31 -04:00
Imbris
69a1a661b6 fixes and tweaks (various minor changes related to UI image scaling on
GPU)
2023-04-08 00:28:31 -04:00
Imbris
d62bf8a790 init (scaling UI images during sampling on the GPU instead of on the CPU) 2023-04-08 00:28:28 -04:00