Commit Graph

662 Commits

Author SHA1 Message Date
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
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
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
Joshua Barretto
9645172135 Slightly smoother FxUpscale 2023-04-01 18:06:20 +01:00
flo
bf81ffc029 frost_gigas 2023-02-15 00:10:37 +00:00
Joshua Barretto
75e07c04f0 Merge branch 'zesterer/glowing-sprites' into 'master'
Added support for glowing sprites

See merge request veloren/veloren!3771
2023-01-19 22:31:30 +00:00
Joshua Barretto
d9552f7ff4 Added support for glowing sprites 2023-01-19 21:59:02 +00:00
Avi Weinstock
aba6f6654e Add a new particle mode for potion sickness. 2023-01-19 15:06:14 -05:00
Joshua Barretto
c12e6426fa Fixed rain drop normals and wind direction for sprites 2023-01-15 19:13:18 +00:00
Isse
5378d1b11d Fix doors 2023-01-15 05:13:02 +00:00
Joshua Barretto
fc564f5313 Fixed internal water reflections and improved underwarper 2023-01-13 11:37:27 +00:00
Joshua Barretto
b127cff26c Merge branch 'zesterer/gbuffers-ssr' into 'master'
Use normal and material gbuffer to improve quality of SSR

See merge request veloren/veloren!3734
2023-01-12 20:26:41 +00:00
Joshua Barretto
49749c86a7 Made emissive figures behave correctly 2023-01-12 18:44:26 +00:00
Joshua Barretto
4d7526b920 Made point shadows with shadow mapping an experimental shader 2023-01-12 15:39:11 +00:00
Joshua Barretto
0bdc66b10a Addressed review comments, minor fixes 2023-01-12 15:30:13 +00:00
Joshua Barretto
0067825187 Reflection smearing 2022-12-31 19:19:52 +00:00
Joshua Barretto
f48e1ca951 Make wind sway change according to weather wind velocity 2022-12-31 17:40:40 +00:00
Joshua Barretto
1f2d56c032 Better reflections 2022-12-31 13:04:28 +00:00
Joshua Barretto
313527cf46 Correct material for LoD water 2022-12-30 19:22:07 +00:00
Joshua Barretto
6e344f58e8 Remove unnecessary cloud sampling from shiny water 2022-12-30 17:33:54 +00:00
Joshua Barretto
799bb17d75 Fixed underground sky blend test 2022-12-30 17:24:36 +00:00
Joshua Barretto
4bd7ec26d3 Fixed drop shadows 2022-12-30 17:01:26 +00:00
Joshua Barretto
367ec3e8f4 Added ViewMaterials experimental shader 2022-12-30 16:42:56 +00:00
Joshua Barretto
9098abc3d2 Merge reflections on horizontal border 2022-12-30 16:30:29 +00:00
Joshua Barretto
78fbaa82b3 Fixed ViewNormals 2022-12-30 16:26:32 +00:00
Joshua Barretto
c6fc833acb Don't blend sky for underwater reflections 2022-12-30 16:23:38 +00:00
Joshua Barretto
d50bda8d09 Better SSR sky blending 2022-12-30 16:01:06 +00:00
Joshua Barretto
26a98a3d9b Use normal and material gbuffer to improve quality of SSR 2022-12-30 15:33:23 +00:00
Joshua Barretto
dcc4762106 Fixed moon lighting of clouds 2022-12-17 15:04:57 +00:00
Joshua Barretto
5cf3aefb87 Better storm clouds 2022-12-17 14:57:55 +00:00
Joshua Barretto
94c0e3749e Improved cloud visuals and performance 2022-12-15 23:56:28 +00:00
Justin Shipsey
420e824a3e Merge branch 'train-track-shadows' into 'master'
Train track shadows

See merge request veloren/veloren!3688
2022-11-12 13:00:24 +00:00
Avi Weinstock
18657fdb66 Render train tracks to the shadow map. 2022-11-06 20:54:58 -05:00
Avi Weinstock
db251273ed Apply shadow map shadows to train tracks. 2022-11-06 18:09:07 -05:00
Samuel Keiffer
72bffe0df8 Merge branch 'train-tracks' into 'master'
Train tracks

See merge request veloren/veloren!3679
2022-11-05 22:56:07 +00:00
Avi Weinstock
f5c1293e9f Address review comments for MR 3679:
- Fix normal vectors/lighting for train tracks.
- Adjust chat command logging statement.
- Remove train tracks when their chunks get unloaded.
- Create a struct for the 6-tuple returned from `get_nearest_ways`.
- Move code that creates the train tracks into `layers::apply_trains_to`.
2022-11-03 15:20:53 -04:00
Joshua Barretto
b64ca9e698 Tweaked door opening, many entities push grass 2022-11-02 14:44:18 +00:00
Avi Weinstock
ff5acf18d7 Doors now animate opening when entities are near them. 2022-11-01 19:29:51 -04:00
Avi Weinstock
08a50afd9f Mostly working train tracks. 2022-10-28 21:36:42 -04:00
Joshua Barretto
29d40cf509 Added graphics presets 2022-10-27 01:15:40 +01:00
Joshua Barretto
4db88bb22c Better sampling of noisy regions 2022-10-27 01:15:21 +01:00
Joshua Barretto
589f59b771 Improve FxUpscale quality for distant objects 2022-10-27 01:15:21 +01:00
Joshua Barretto
f29b1da583 Implemented FxUpscale 2022-10-27 01:15:20 +01:00
Joshua Barretto
428816c65e Addressed review comments 2022-10-23 23:54:55 +01:00
Joshua Barretto
1521b6165f Prettier cheap water 2022-10-23 21:41:45 +01:00