Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
689970a2 by Fatih Uzunoglu at 2026-01-10T10:01:16+00:00
qt: move `sign(qt_Matrix[3][1])` out of the loop in `VoronoiSnow.frag`
`qt_Matrix` is a uniform, this should ideally not be in the for
loop.
- - - - -
d7415319 by Fatih Uzunoglu at 2026-01-10T10:01:16+00:00
qt: take care of y-flip with D3D in `VoronoiSnow`
- - - - -
2 changed files:
- modules/gui/qt/shaders/VoronoiSnow.frag
- modules/gui/qt/widgets/qml/VoronoiSnow.qml
Changes:
=====================================
modules/gui/qt/shaders/VoronoiSnow.frag
=====================================
@@ -48,6 +48,8 @@ layout(std140, binding = 0) uniform buf {
vec2 windowSize;
float time; // seed
vec4 color; // snowflake color
+
+ int yFlip;
};
// Inigo Quilez's voronoi (https://iquilezles.org/articles/voronoilines):
@@ -143,10 +145,12 @@ void main()
vec3 col = vec3(0.0, 0.0, 0.0);
+ float direction = sign(qt_Matrix[3][1]) * yFlip;
+
// Multiple layers
for (float i = 1.0; i <= LAYER_MAX; i += LAYER_INCREMENT)
{
- vec3 c = voronoi((6.0 * p + sign(qt_Matrix[3][1]) * vec2(sin(time) /
2.0, time)) * i);
+ vec3 c = voronoi((6.0 * p + direction * vec2(sin(time) / 2.0, time)) *
i);
// Snowflake size depends on the layer:
float dist = sdSnowflake(c.yz * 8.0 * i);
=====================================
modules/gui/qt/widgets/qml/VoronoiSnow.qml
=====================================
@@ -37,6 +37,8 @@ ShaderEffect {
property real speed: 1.2 // speed factor
+ readonly property int yFlip: ((GraphicsInfo.api ===
GraphicsInfo.Direct3D11) || (GraphicsInfo.api === GraphicsInfo.Direct3D12)) ?
-1 : 1
+
UniformAnimator on time {
loops: Animation.Infinite
from: 0
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/compare/36d591a3e93dbf99e1d23a3c06e8ace98995e83e...d7415319dcc443159ff0c0c78abee33e85efcca6
--
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/compare/36d591a3e93dbf99e1d23a3c06e8ace98995e83e...d7415319dcc443159ff0c0c78abee33e85efcca6
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits