minetest/games/devtest/mods/testnodes/textures
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
..
testnodes_1.png
testnodes_1f.png
testnodes_1fg.png
testnodes_1g.png
testnodes_1w.png
testnodes_1wg.png
testnodes_2.png
testnodes_2f.png
testnodes_2fg.png
testnodes_2g.png
testnodes_2w.png
testnodes_2wg.png
testnodes_3.png
testnodes_3f.png
testnodes_3fg.png
testnodes_3g.png
testnodes_3w.png
testnodes_3wg.png
testnodes_4.png
testnodes_4f.png
testnodes_4fg.png
testnodes_4g.png
testnodes_4w.png
testnodes_4wg.png
testnodes_5.png
testnodes_5f.png
testnodes_5fg.png
testnodes_5g.png
testnodes_5w.png
testnodes_5wg.png
testnodes_6.png
testnodes_6f.png
testnodes_6fg.png
testnodes_6g.png
testnodes_6w.png
testnodes_6wg.png
testnodes_airlike.png
testnodes_allfaces_optional.png
testnodes_allfaces.png
testnodes_alpha_compositing_bottom.png
testnodes_alpha_compositing_top.png
testnodes_alpha.png
testnodes_alpha64.png
testnodes_alpha128.png
testnodes_alpha191.png
testnodes_anim.png
testnodes_attached_bottom.png
testnodes_attached_side.png
testnodes_attached_top.png
testnodes_attached4_bottom.png
testnodes_attached4_side.png
testnodes_attached4_top.png
testnodes_attachedf_bottom.png
testnodes_attachedf_side.png
testnodes_attachedf_top.png
testnodes_attachedfr_bottom.png
testnodes_attachedfr_side.png
testnodes_attachedfr_top.png
testnodes_attachedw_bottom.png
testnodes_attachedw_side.png
testnodes_attachedw_top.png
testnodes_attachedwr_bottom.png
testnodes_attachedwr_side.png
testnodes_attachedwr_top.png
testnodes_blocking_pointable.png
testnodes_bouncy.png
testnodes_buildable_to.png
testnodes_climbable_noclimb_side.png
testnodes_climbable_noclimb_top.png
testnodes_climbable_nodescend_side.png
testnodes_climbable_nodescend_top.png
testnodes_climbable_nojump_side.png
testnodes_climbable_nojump_top.png
testnodes_climbable_resistance_side.png
testnodes_climbable_side.png
testnodes_climbable_top.png
testnodes_damage_neg.png
testnodes_damage.png
testnodes_drowning.png
testnodes_fall_damage_minus.png
testnodes_fall_damage_plus.png
testnodes_fencelike.png
testnodes_fill_positioning_reference.png
testnodes_firelike.png
testnodes_glasslike_detail.png
testnodes_glasslike_framed_optional.png
testnodes_glasslike_framed.png
testnodes_glasslike_framed2.png
testnodes_glasslike.png
testnodes_glasslikeliquid.png
testnodes_light_1.png
testnodes_light_2.png
testnodes_light_3.png
testnodes_light_4.png
testnodes_light_5.png
testnodes_light_6.png
testnodes_light_7.png
testnodes_light_8.png
testnodes_light_9.png
testnodes_light_10.png
testnodes_light_11.png
testnodes_light_12.png
testnodes_light_13.png
testnodes_light_14.png
testnodes_light.png
testnodes_line_crossing.png
testnodes_line_curved.png
testnodes_line_straight.png
testnodes_line_t_junction.png
testnodes_liquid.png
testnodes_liquidflowing_r1.png
testnodes_liquidflowing_r2.png
testnodes_liquidflowing_r3.png
testnodes_liquidflowing_r4.png
testnodes_liquidflowing_r5.png
testnodes_liquidflowing_r6.png
testnodes_liquidflowing_r7.png
testnodes_liquidflowing_r8.png
testnodes_liquidflowing_r0.png
testnodes_liquidflowing.png
testnodes_liquidsource_r1.png
testnodes_liquidsource_r2.png
testnodes_liquidsource_r3.png
testnodes_liquidsource_r4.png
testnodes_liquidsource_r5.png
testnodes_liquidsource_r6.png
testnodes_liquidsource_r7.png
testnodes_liquidsource_r8.png
testnodes_liquidsource_r0.png
testnodes_liquidsource.png
testnodes_marble_glass.png
testnodes_marble_metal_overlay.png
testnodes_marble_metal.png
testnodes_mesh_stripes.png
testnodes_mesh_stripes2.png
testnodes_mesh_stripes3.png
testnodes_mesh_stripes4.png
testnodes_mesh_stripes5.png
testnodes_mesh_stripes6.png
testnodes_mesh_stripes7.png
testnodes_mesh_stripes8.png
testnodes_mesh_stripes9.png
testnodes_mesh_stripes10.png
testnodes_move_resistance.png
testnodes_node_falling_1.png
testnodes_node_falling_2.png
testnodes_node_falling_3.png
testnodes_node_falling_4.png
testnodes_node_falling_5.png
testnodes_node_falling_6.png
testnodes_node_falling.png
testnodes_node.png
testnodes_nodebox.png
testnodes_nojump_side.png
testnodes_nojump_top.png
testnodes_normal.png
testnodes_normal1.png
testnodes_normal2.png
testnodes_normal3.png
testnodes_normal4.png
testnodes_normal5.png
testnodes_normal6.png
testnodes_not_pointable.png
testnodes_overlay.png
testnodes_overlayable.png
testnodes_palette_4dir.png
testnodes_palette_facedir.png
testnodes_palette_full.png
testnodes_palette_metal.png
testnodes_palette_wallmounted.png
testnodes_plantlike_degrotate.png
testnodes_plantlike_leveled.png
testnodes_plantlike_meshoptions.png
testnodes_plantlike_rooted_base_side_degrotate.png
testnodes_plantlike_rooted_base_side_leveled.png
testnodes_plantlike_rooted_base_side_meshoptions.png
testnodes_plantlike_rooted_base_side_wallmounted.png
testnodes_plantlike_rooted_base_side_waving.png
testnodes_plantlike_rooted_base.png
testnodes_plantlike_rooted_degrotate.png
testnodes_plantlike_rooted_leveled.png
testnodes_plantlike_rooted_meshoptions.png
testnodes_plantlike_rooted_wallmounted.png
testnodes_plantlike_rooted_waving.png
testnodes_plantlike_rooted.png
testnodes_plantlike_wallmounted.png
testnodes_plantlike_waving.png
testnodes_plantlike.png
testnodes_pointable.png
testnodes_post_effect_color_shaded_false.png
testnodes_post_effect_color_shaded_true.png
testnodes_rail_crossing.png
testnodes_rail_curved.png
testnodes_rail_straight.png
testnodes_rail_t_junction.png
testnodes_rail2_crossing.png
testnodes_rail2_curved.png
testnodes_rail2_straight.png
testnodes_rail2_t_junction.png
testnodes_sign3d.png
testnodes_signlike.png
testnodes_slippery.png
testnodes_street_crossing.png
testnodes_street_curved.png
testnodes_street_straight.png
testnodes_street_t_junction.png
testnodes_sunlight_filter.png
testnodes_tga_type1_24bpp_bt.tga
testnodes_tga_type1_24bpp_tb.tga
testnodes_tga_type2_16bpp_bt.tga
testnodes_tga_type2_16bpp_tb.tga
testnodes_tga_type2_32bpp_bt.tga
testnodes_tga_type2_32bpp_tb.tga
testnodes_tga_type3_16bpp_bt.tga
testnodes_tga_type3_16bpp_tb.tga
testnodes_tga_type10_32bpp_bt.tga
testnodes_tga_type10_32bpp_tb.tga
testnodes_torchlike_ceiling.png
testnodes_torchlike_floor.png
testnodes_torchlike_wall.png