Commit Graph

13392 Commits

Author SHA1 Message Date
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
Samuel Keiffer
162509e1c9 Merge branch 'sam/durability' into 'master'
Durability

See merge request veloren/veloren!3509
2023-04-06 22:42:52 +00: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
Sam
4ec2798262 Fix velorite sprite offset 2023-04-06 10:57:19 -04:00
Sam
d523d31056 Fixed possible crash in crafting UI 2023-04-06 10:57:18 -04:00
Sam
7fab9d192b Add repair bench to desert and cliff towns. 2023-04-06 10:57:18 -04:00
Sam
038929d66d New models for ores and repair bench 2023-04-06 10:57:17 -04:00
Monty Marz
29a7520a48 adjusted death message, fixed repair bench text 2023-04-06 10:57:17 -04:00
Sam
a68ef7af30 Tweaks 2023-04-06 10:57:16 -04:00
Sam
132f26dbc0 Addressed review 2023-04-06 10:57:16 -04:00
Sam
79812a7326 Addressed persistence review comments. 2023-04-06 10:57:15 -04:00
Sam
f7765a8471 Added some repair recipes for some missed items. 2023-04-06 10:57:15 -04:00
Sam
92165a8fd8 Repair recipes no longer show ingredients as required when they are not damaged enough to need any 2023-04-06 10:57:14 -04:00
Sam
6a8fc3a423 Tweaked repair recipes 2023-04-06 10:57:14 -04:00
Sam
ff9f755c0c Changed repair recipe to round down on material costs. 2023-04-06 10:57:13 -04:00
Sam
00710a4eb0 Fixed csv tools 2023-04-06 10:57:13 -04:00
UncomfySilence
3dae7b6d4a small tweaks to repair recipe and addition of cultist, and uncraftable weapon repairs 2023-04-06 10:57:12 -04:00
Sam
e4ebd17363 Addressed feedback 2023-04-06 10:57:12 -04:00
Sam
807a8bcea0 Changelog 2023-04-06 10:57:08 -04:00
Sam
ca879173be Added a repair equipped and a repair all button. Cleaned up some hacks that used to exist. 2023-04-06 10:56:55 -04:00
Sam
658de93c59 Repairing UI 2023-04-06 10:56:53 -04:00
Sam
536d88a2c7 Repair costs scale based on how damaged the item is. 2023-04-06 10:54:50 -04:00
UncomfySilence
85ceae3354 repair recipes for armor pieces 2023-04-06 10:54:50 -04:00
Sam
52a62420db Changed durability persistence to a NonZeroU32 2023-04-06 10:54:49 -04:00
Sam
011b6c3feb Changed how durability was persisted so that a more general system can be used for future item properties. 2023-04-06 10:54:49 -04:00
Sam
0966753699 Added repair recipes 2023-04-06 10:54:48 -04:00
Sam
c3f5bc13f1 Equipment can now be repaired at sprites in town. 2023-04-06 10:54:48 -04:00
Sam
a555e08d0b Added durability to item tooltips 2023-04-06 10:54:47 -04:00
Sam
c586db8feb Item durability is now persisted 2023-04-06 10:54:47 -04:00
Sam
a07e042fa2 Items now lose durability on death 2023-04-06 10:54:46 -04:00
Sam
df13741be9 Durability system in place 2023-04-06 10:54:46 -04:00