Commit Graph

17 Commits

Author SHA1 Message Date
HybridDog
cda112493a
Faster blit_with_alpha() (#14448)
* Add test nodes for alpha compositing and the fill texture modifier

Texture test nodes can be helpful to test if `blit_with_alpha` works correctly.

The alpha compositing test node covers different cases where pixel colors are mixed with each other.
The test currently fails because `blitPixel` does not work correctly if a semi-transparent color
is drawn on top of another semi-transparent color.
The test nodes for the fill texture modifier show if the size and position arguments of the modifier work correctly.
They do not cover special cases such as very large or negative position or size values.

* Faster blit_with_alpha()

The `blit_with_alpha` function has a noticeable effect on the time it takes to join a game.

To reduce the join times, I replace the `blit_with_alpha` function with a new one:
* It does not uses floating-point numbers.
* It directly operates on the raw pixel data instead of using the comparatively
  slow `setPixel` and `getPixel` functions from Irrlicht.
  Only ECF_A8R8G8B8 base images are supported now.
  If the top image does not have the ECF_A8R8G8B8 color format, it is converted;
  I assume that this happens rarely.
* There are case distinctions for fully opaque, fully transparent and semi-transparent pixels.
  This empirically increases the performance since the mixing between two semi-transparent happens rarely.
* The new function no longer has the `src_pos` argument since it was always the zero vector.
* The function is only documented once where it is declared.

For backwards compatibility, `blit_with_alpha` still mixes colors without gamma correction.
`blit_with_alpha` nonetheless behaves slightly different than before:
If a semi-transparent pixel is drawn on top of another semi-transparent pixel,
the color is mixed in a way which we can consider to be more correct now.
2024-03-19 19:56:47 +01:00
cx384
5958714309
Tool specific pointing and blocking pointable type (#13992) 2024-01-22 18:27:08 +01:00
Wuzzy
08ee6d8d4b
Add rotation support for wallmounted nodes in 'ceiling' or 'floor' mode (#11073) 2024-01-17 17:47:06 +01:00
Thresher
352a403bd0
Optimize PNG files (#13509) 2023-10-09 17:13:44 +02:00
Gregor Parzefall
aea9242a96
Allow nodes to have their post_effect_color affected by lighting (#13637)
Co-authored-by: DS <ds.desour@proton.me>
2023-08-24 20:16:36 +02:00
doxygen-spammer
9f25378ddd
Add performance test nodes, using complex meshes. (#13161) 2023-07-30 14:53:08 +01:00
Wuzzy
8e1af25738 DevTest: Add example nodes for disable_descend 2023-06-16 20:14:08 +02:00
Wuzzy
3c7f26d937
Add support for attached facedir/4dir nodes (#11432) 2022-11-24 17:56:07 -05:00
Wuzzy
c73d79841c DevTest: More node textures to tell them apart 2022-10-23 21:58:56 +02:00
Wuzzy
1d04903c19
Add paramtype2s for 4 horizontal rotations and 64 colors (#11431)
4dir is like facedir, but only for 4 horizontal directions: NESW. It is identical in behavior to facedir otherwise. The reason why game makers would want to use this over facedir is 1) simplicity and 2) you get 6 free bits.
It can be used for things like chests and furnaces and you don't need or want them to "flip them on the side" (like you could with facedir).

color4dir is like colorfacedir, but you get 64 colors instead of only 8.
2022-09-16 13:18:55 +02:00
Wuzzy
fe299e24d6
DevTest: Add nodes and items for testing overlays (#12304) 2022-05-27 21:39:36 +02:00
Nils Dagsson Moskopp
7c227d2a00
Add TGA test nodes to devtest (#11978) 2022-02-22 19:17:40 +01:00
Wuzzy
21113ad410
Split liquid_viscosity to liquid_viscosity and move_resistance (#10810) 2021-10-01 16:21:24 +02:00
Wuzzy
f4d8cc0f0b
Add wallmounted support for plantlike and plantlike_rooted nodes (#11379) 2021-07-15 21:19:59 +02:00
Wuzzy
9b64834c6a
Devtest: Remove bumpmap/parallax occl. test nodes (#10902) 2021-02-04 21:43:29 +01:00
HybridDog
c61c175e9c
Add bumpmapping and parallax occlusion testing nodes to devtest (#9242) 2020-10-09 19:13:42 +01:00
Wuzzy
083b285f43
Rename “Minimal development test” to “Development Test” (#9928) 2020-05-26 00:17:52 +02:00