이 페이지에서

GridMesh QML Type

정점이 격자 형태로 배열된 메쉬를 정의합니다. 더 보기...

Import Statement: import QtQuick

속성

상세 설명

GridMesh는 균일한 간격으로 배열된 정점들로 구성된 직사각형 메쉬를 정의합니다. 이 메쉬는 geometry 를 생성하는 데 사용됩니다. 그리드 해상도는 resolution 속성을 통해 지정됩니다.

속성 설명

resolution : size

이 속성은 그리드 해상도를 지정합니다. 해상도의 너비와 높이는 각각 수평 및 수직 방향으로의 셀 수 또는 정점 간의 간격을 나타냅니다. 최소값이자 기본값은 1x1이며, 이는 네 모서리에 각각 하나씩 총 네 개의 정점에 해당합니다. 비선형 정점 변환의 경우 해상도를 더 높게 설정하는 것이 좋습니다.

결과QML 코드gridmesh.vert

GridMesh 변환으로 인해 Qt 로고가 왜곡됨

import QtQuick 2.0

ShaderEffect {
    width: 200
    height: 200
    mesh: GridMesh {
        resolution: Qt.size(20, 20)
    }
    property variant source: Image {
        source: "qt-logo.png"
        sourceSize { width: 200; height: 200 }
    }
    vertexShader: "gridmesh.vert"
}
#version 440
layout(location = 0) in vec4 qt_Vertex;
layout(location = 1) in vec2 qt_MultiTexCoord0;
layout(location = 0) out vec2 qt_TexCoord0;
layout(std140, binding = 0) uniform buf {
    mat4 qt_Matrix;
    float qt_Opacity;
    float width;
};
void main() {
    vec4 pos = qt_Vertex;
    float d = 0.5 * smoothstep(0.0, 1.0, qt_MultiTexCoord0.y);
    pos.x = width * mix(d, 1.0 - d, qt_MultiTexCoord0.x);
    gl_Position = qt_Matrix * pos;
    qt_TexCoord0 = qt_MultiTexCoord0;
}

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.