MultiSampleAntiAliasing QML Type
マルチサンプル・アンチエイリアスを有効にする。詳細...
Import Statement: | import Qt3D.Render 2.8 |
In C++: | QMultiSampleAntiAliasing |
Inherits: | |
Status: | Deprecated |
詳細説明
MultiSampleAntiAliasing型は、マルチサンプル・アンチエイリアシングを有効にする。
これは、RenderPass :
RenderPass { shaderProgram: ShaderProgram { // ... } renderStates: [ MultiSampleAntiAliasing {} ] }
またはRenderStateSet に追加できます:
RenderStateSet { renderStates: [ MultiSampleAntiAliasing {} ] }
マルチサンプリングを有効にするには、レンダーターゲットがマルチサンプリングを有効にした状態で割り当てられている必要があります:
RenderTarget { attachments: [ RenderTargetOutput { attachmentPoint: RenderTargetOutput.Color0 texture: Texture2DMultisample { width: 1024 height: 1024 format: Texture.RGBA8_UNorm } }, RenderTargetOutput { attachmentPoint: RenderTargetOutput.DepthStencil texture: Texture2DMultisample{ width: 1024 height: 1024 format: Texture.D24S8 } } ] }
さらに、シェーダコードは、マルチサンプリング サンプラータイプと、texture() の代わりに texelFetch() を使用しなければなりません。
さらに、シェーダコードは、マルチサンプリングサンプラータイプと、texture()の代わりにtexelFetch()を使用しなければなりません。
たとえば
#version 150 uniform sampler2D colorTexture; in vec2 texCoord; out vec4 fragColor; void main() { fragColor = texture(colorTexture, texCoord); }
のように書き換えることができます。
#version 150 uniform sampler2DMS colorTexture; in vec2 texCoord; out vec4 fragColor; void main() { ivec2 tc = ivec2(floor(textureSize(colorTexture) * texCoord)); vec4 c = texelFetch(colorTexture, tc, 0) + texelFetch(colorTexture, tc, 1) + texelFetch(colorTexture, tc, 2) + texelFetch(colorTexture, tc, 3); fragColor = c / 4.0; }
注意: グラフィックスAPIとしてOpenGLを使用する場合、MultiSampleAntiAliasingがレンダリングステートに追加されていると、glEnable(GL_MULTISAMPLE)が呼び出されます。
© 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.