MultiSampleAntiAliasing QML Type
다중 샘플 앤티앨리어싱을 활성화합니다. 더 보기...
| Import Statement: | import Qt3D.Render 2.12 |
| 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()를 사용해야 합니다.
또한, 셰이더 코드에서는 텍스처() 대신 멀티샘플링 샘플러 유형과 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;
}참고: OpenGL을 그래픽 API로 사용할경우 , 렌더 스테이트에 MultiSampleAntiAliasing이 추가되어 있으면 glEnable(GL_MULTISAMPLE)이 호출됩니다.
© 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.