OpenGL 3.3 MSAA延迟着色

时间:2022-09-06 18:50:22

From what I understand I can have automatic MSAA for deferred shading in OpenGL 3.3 by specifying multisample textures/renderbuffers when creating my framebuffer (at a high memory cost). Does this multisampling also have any implications on the shaders, for either the geometry pass or the shading pass or is it all handled "under the hood"?

据我所知,我可以在OpenGL 3.3中通过在创建framebuffer时指定多样本纹理/renderbuffers来实现延迟着色的自动MSAA(内存开销很大)。这个多采样是否对材质也有任何影响,无论是几何图形或阴影,还是所有的处理都在“引擎盖下”?

1 个解决方案

#1


2  

Nope, you cannot have automatic MSAA in this case. It was literally called explicit multisample when it was first introduced to OpenGL for a reason.

不,在这种情况下你不能使用自动MSAA。当它第一次被引入OpenGL时,字面上被称为显式多样本。

You have to fetch each of the samples from your multisample texture and do the MSAA resolve yourself in the shader. Multisample color textures are a DX10 hardware feature, multisample depth textures are a DX10.1 feature but OpenGL makes this pretty transparent. Since multisample textures were not introduced to GL until after DX10.1, in most cases you get both (multisample color + depth) in GL.

您必须从您的多样本纹理中获取每个样本,并自己在着色器中进行MSAA解析。多样本颜色纹理是一个DX10硬件特性,多样本深度纹理是一个DX10.1特性,但是OpenGL使这个非常透明。由于直到DX10.1之后才将多样本纹理引入到GL中,所以在大多数情况下,在GL中您会同时获得这两种纹理(多样本颜色+深度)。

I have an old answer here that might help to further clear things up.

我有一个老的答案,可能有助于进一步澄清问题。

#1


2  

Nope, you cannot have automatic MSAA in this case. It was literally called explicit multisample when it was first introduced to OpenGL for a reason.

不,在这种情况下你不能使用自动MSAA。当它第一次被引入OpenGL时,字面上被称为显式多样本。

You have to fetch each of the samples from your multisample texture and do the MSAA resolve yourself in the shader. Multisample color textures are a DX10 hardware feature, multisample depth textures are a DX10.1 feature but OpenGL makes this pretty transparent. Since multisample textures were not introduced to GL until after DX10.1, in most cases you get both (multisample color + depth) in GL.

您必须从您的多样本纹理中获取每个样本,并自己在着色器中进行MSAA解析。多样本颜色纹理是一个DX10硬件特性,多样本深度纹理是一个DX10.1特性,但是OpenGL使这个非常透明。由于直到DX10.1之后才将多样本纹理引入到GL中,所以在大多数情况下,在GL中您会同时获得这两种纹理(多样本颜色+深度)。

I have an old answer here that might help to further clear things up.

我有一个老的答案,可能有助于进一步澄清问题。