Qt Quick 3D - 反锯齿示例
演示Qt Quick 3D 中的抗锯齿模式。
抗锯齿示例演示了如何在Qt Quick 3D 中控制抗锯齿。该示例显示了一个显示抗锯齿伪影的简单场景。Qt Quick 用户界面非常简单,可在不同的抗锯齿类型之间进行选择,并设置控制抗锯齿的选项。
测试场景
本例显示了一个包含一个球体和两个旋转立方体的简单场景。该场景设置为在未启用抗锯齿功能时可清晰显示锯齿状边缘。
控制抗锯齿
抗锯齿由SceneEnvironment 对象控制。数值根据用户界面的选择进行设置。
antialiasing mode 可设置为NoAA
以禁用抗锯齿,也可设置为以下值之一:
SSAA
超采样抗锯齿MSAA
多采样抗锯齿ProgressiveAA
逐行抗锯齿
antialiasing quality 可设置为Medium
、High
或VeryHigh
。
此外,还可以单独启用temporal antialiasing 。
environment: SceneEnvironment { id: sceneEnvironment clearColor: "#002b36" backgroundMode: SceneEnvironment.Color antialiasingMode: modeButton1.checked ? SceneEnvironment.NoAA : modeButton2.checked ? SceneEnvironment.SSAA : modeButton3.checked ? SceneEnvironment.MSAA : SceneEnvironment.ProgressiveAA antialiasingQuality: qualityButton1.checked ? SceneEnvironment.Medium : qualityButton2.checked ? SceneEnvironment.High : SceneEnvironment.VeryHigh temporalAAEnabled: temporalModeButton.checked temporalAAStrength: temporalStrengthSlider.value }
有关抗锯齿的进一步讨论,请参阅资产调节部分的抗锯齿页面。
© 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.