Commit Graph

13353 Commits

Author SHA1 Message Date
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
Christof Petig
564530f5e2 Merge branch 'hudson/fix_loot_scroller_bug' into 'master'
fixed a visual ui bug when picking up items

See merge request veloren/veloren!3860
2023-04-06 20:44:02 +00:00
Hudson
e03406b103 fixed a bug where if a group member picks up an item, then the player picks up an item, it would display the incorrect number of items picked up. example: group member picks up an apple, then player picks up an apple, the ui would display that the player picked up two apples, instead of the group member picking up one and the player picking up one 2023-04-06 13:43:11 -05:00
Hudson
4881d2fd8b fixed a bug where if a group member picks up an item, then the player picks up an item, it would display the incorrect number of items picked up. example: group member picks up an apple, then player picks up an apple, the ui would display that the player picked up two apples, instead of the group member picking up one and the player picking up one 2023-04-06 12:40:08 -05:00
Christof Petig
73cd4e5136 Merge branch 'christof/wasmer_update' into 'master'
update wasmer

See merge request veloren/veloren!3857
2023-04-06 07:22:24 +00:00
Christof Petig
49e734fa0b Merge branch 'christof/multi_model_vox' into 'master'
Support multiple models in one vox file, e.g. for figures

See merge request veloren/veloren!3830
2023-04-06 07:09:20 +00:00
Christof Petig
7ab2bcd4e4 revert unwanted regressions as indicated by imbris 2023-04-06 08:30:49 +02:00
Samuel Keiffer
41e551f32d Merge branch 'smol_sword_nerf' into 'master'
Teeny changes to crippling stance abilities

See merge request veloren/veloren!3855
2023-04-05 23:17:57 +00:00
Youssef Fahmy
7c85460f18 Teeny changes to crippling stance abilities 2023-04-05 23:17:57 +00:00
Christof Petig
8fac5192cc update wasmer 2023-04-05 22:19:28 +02:00
Imbris
76bfae38a0 Merge branch 'imbris/update-conrod-copypasta' into 'master'
Update copypasta version used by conrod

See merge request veloren/veloren!3854
2023-04-05 07:19:16 +00:00
Imbris
9dd1b6c785 Switch from ansi-parser to cansi, down to a single version of nom! 2023-04-05 02:38:58 -04:00
Imbris
6ed75fa3aa Update tynm dependency (had to update nom first) 2023-04-04 22:25:32 -04:00
Joshua Barretto
15ada6f25e Merge branch 'tony/patch_underwater_fall_damage_bug' into 'master'
Temporarily patch underwater fall damage bug

See merge request veloren/veloren!3853
2023-04-04 22:25:32 +00:00
Christof Petig
e60aace448 realize zesterers proposal 2023-04-05 00:11:26 +02:00
Imbris
8352e4efae Update copypasta version used by conrod so that we can avoid dependence on old xcb that will fail to compile soon due to dependency on quick-xml 0.22.0
See https://gitlab.com/veloren/veloren/-/issues/1815
2023-04-04 18:07:09 -04:00
Christof Petig
f4a87e9f0b cargo fmt 2023-04-04 23:47:31 +02:00
Christof Petig
8d2b9b9a9c single file orichalcum armor 2023-04-04 23:46:20 +02:00
Christof Petig
4da41b0dd0 move alchemist set to single file (with reduced hat size) 2023-04-04 23:46:20 +02:00
Christof Petig
e26cbffa0c correct offsets from animation settings 2023-04-04 23:46:20 +02:00
Christof Petig
5cb974f770 cargo fmt 2023-04-04 23:46:20 +02:00
Christof Petig
76baf491ec support model indices for humanoids 2023-04-04 23:46:20 +02:00
Christof Petig
fb06bb651b a single llama file (smaller) 2023-04-04 23:46:20 +02:00
Christof Petig
0b8bc507ac fix clippy 2023-04-04 23:46:20 +02:00
Christof Petig
9205da2298 cargo fmt 2023-04-04 23:46:20 +02:00
Christof Petig
b1dc85dc0f llama in one vox file 2023-04-04 23:46:20 +02:00
Christof Petig
9b3bf4c3c8 initial support for multiple models in one vox file 2023-04-04 23:46:20 +02:00
Antonios Barotsis
34cdd2d7f5 fmt 2023-04-04 23:25:11 +02:00
Antonios Barotsis
d292026935 Added fix to changelog 2023-04-04 23:23:04 +02:00
Antonios Barotsis
093b1c924c Refactored according to review 2023-04-04 23:16:00 +02:00
Antonios Barotsis
3adea9cdbb Temporarily patch underwater fall damage bug 2023-04-04 19:16:58 +02:00
Joshua Barretto
b3cd1c1e56 Merge branch 'inventory-list' into 'master'
Add a list mode to inventories to make it easier to see item names at merchants.

See merge request veloren/veloren!3755
2023-04-04 16:54:15 +00:00
Marcel
914f93e18a Merge branch 'tygyh/Update-swedish-translations' into 'master'
Update swedish translations

See merge request veloren/veloren!3847
2023-04-03 21:40:32 +00:00
Avi Weinstock
908b2a62fa Change item color in details mode. 2023-04-03 15:40:34 -04:00
Avi Weinstock
6899023fde Sort merchant inventories lexicographically by (quality, name, quantity)
in details mode.
2023-04-03 14:43:14 -04:00
Avi Weinstock
8facf7b58d Add a list mode to inventories to make it easier to see item names at merchants. 2023-04-03 14:43:14 -04:00
Samuel Keiffer
494019ecc2 Merge branch 'sam/polymorph-buff-fix' into 'master'
Fix multiple polymorph buffs

See merge request veloren/veloren!3850
2023-04-02 22:45:54 +00:00
Joshua Barretto
17cdd3e38d Merge branch 'zesterer/choose-starting-site' into 'master'
Allow new players to choose their starting site

See merge request veloren/veloren!3848
2023-04-02 00:45:25 +00:00
Joshua Barretto
ab5561df61 Removed redundant things 2023-04-02 01:09:12 +01:00
Monty Marz
33e643fbfd fmt 2023-04-02 01:21:10 +02:00
Samuel Keiffer
f2419e2920 Merge branch 'sam/fix-modular-craft' into 'master'
Fix modular output item showing an item for disallowed combinations

See merge request veloren/veloren!3852
2023-04-01 23:01:05 +00:00
Monty Marz
d1f6db9da6 different site name col 2023-04-02 00:55:21 +02:00
Sam
6849f9fc21 Fix function name typo 2023-04-01 18:11:16 -04:00