Shader QML Type
用于定义后处理特效所用着色器代码的容器组件。更多
Import Statement: | import QtQuick3D |
Inherits: |
属性
详细说明
着色器类型用于在Effect 的渲染pass 中填充shaders 列表。
着色器是在渲染流水线的特定stage 上直接在图形硬件上执行的代码。
另请参阅 Effect 。
属性文档
shader : url |
指定着色器源文件的名称。有关如何编写着色器代码的详细信息,请参阅Effect 文档。
警告: 着色器片段被假定为可信内容。建议应用程序开发人员在允许加载非应用程序一部分的用户提供内容之前,仔细考虑其潜在影响。
stage : enumeration |
指定执行着色器代码的渲染流水线阶段。默认值为Shader.Fragment
常量 | 说明 |
---|---|
Shader.Vertex | 着色器是顶点着色器。该代码在输入几何体的每个顶点运行一次,可用于在几何体光栅化(扫描转换)前对其进行修改。在特效情况下,输入几何体总是一个四边形(四个顶点代表渲染目标的四个角)。 |
Shader.Fragment | 着色器是片段着色器。顶点处理后,修改后的几何图形会被转化为片段(光栅化)。然后针对每个片段执行片段着色器,为其分配颜色。片段是一个与像素相关的概念,但附加了额外的信息。此外,由于某些抗锯齿策略,输出中的每个像素可能不止一个片段。 |
© 2025 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.