MultiSampleAntiAliasing QML Type
다중 샘플 앤티앨리어싱을 활성화합니다. 더 보기...
Import Statement: | import Qt3D.Render 2.8 |
In C++: | QMultiSampleAntiAliasing |
Inherits: | |
Status: | Deprecated |
상세 설명
멀티샘플 앤티앨리어싱 유형은 멀티샘플 앤티앨리어싱을 활성화합니다.
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.