1
0
mirror of synced 2025-01-08 12:41:38 +01:00
ImHex/plugins/visualizers
paxcut 4b3bf2f358
fix: Textures, uv coordinates and light source not updating properly. (#1872)
### Problem description
The only time textures would update was through the file picker. Once UV
coordinates were used, disabling them didn't have any effect because the
vertex array didn't invalidate the corresponding buffer array. When
`shouldUpdate` is true, the light source needs to know as well,
otherwise it will set the location at 0,0.

### Implementation description

Textures were fixed by creating a member variable that holds the file
name of the texture used in the last model rendering.

Instead of invalidating buffer arrays it is much simpler to define a
default UV coordinate set for the case when no UV is specified. if a
texture is not present then the values of UV will not be used. If there
is a texture it must be a minimum of 1 pixel in size. So we choose the
UV coordinates so that every vertex gets assigned the color at the 0,0
coordinate of the texture.

When `shouldUpdate` is on, we also turn `shouldUpdateLightSource` on.

Also included are some formatting changes that are purely aesthetic.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2024-11-24 11:18:19 +01:00
..
include/content refactor: Rework features that use external libraries into optional plugins (#1470) 2023-12-23 21:09:41 +01:00
romfs lang: Update Chinese (Simplified) translations (#1894) 2024-09-15 15:17:25 +02:00
source fix: Textures, uv coordinates and light source not updating properly. (#1872) 2024-11-24 11:18:19 +01:00
CMakeLists.txt feat: Added digital signal pattern visualizer 2024-06-20 14:04:05 +02:00