1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00
Commit graph

14 commits

Author SHA1 Message Date
sfan5
486fb7cc4d Add caching of generated textures as image 2025-05-03 11:32:41 +02:00
sfan5
9cb78f2dc5 Try to reuse texture objects in TextureSource::rebuildTexture() 2025-05-03 11:32:41 +02:00
sfan5
b841c23701 Clean up TextureSource and related code 2025-05-03 11:32:41 +02:00
grorp
f54d209bc8
Remove normal map leftovers (#15609)
leftovers from #10487 / ed22260822
2024-12-31 19:28:57 +01:00
sfan5
f37f9a6f0b Optimize getImageAverageColor
also fixes a bug with non-square handling

before:
  getImageAverageColor [us] _____________________  804x  11.253

after:
  imageAverageColorInline [us] __________________  804x   0.557
2024-12-31 14:47:46 +01:00
sfence
d849d51c2d
Replace licensing text in headers (LGPLv2.1) (#15321) 2024-10-28 15:57:39 +01:00
SmallJoker
4975afb5ff Clean up header includes related to settings.h 2024-10-17 19:38:49 +02:00
sfan5
275bef0633 Remove unused leftovers from normal mapping 2024-09-07 14:23:37 +02:00
sfan5
e55fb6da71 Mark a bunch of classes as final 2024-09-02 21:50:13 +02:00
cx384
673d2499e8 Refactor texturepaths.cpp and SourceImageCache 2024-03-30 11:06:44 +01:00
cx384
6ac053bbaa Extract image generation/cache from texturesource.cpp 2024-03-30 11:06:44 +01:00
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
SmallJoker
02a893d613 Client: fix failing assert on empty texture name 2024-03-10 10:50:04 +01:00
cx384
aaf77025b6 Split up tile.cpp/h 2024-03-03 15:52:05 +01:00