多重采样纹理采样 [英] Multisample texture sampling

查看:80
本文介绍了多重采样纹理采样的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 OpenGL 中对多重采样纹理(即多重采样 FBO 颜色缓冲区)进行采样的唯一方法是使用 texelFetch 并使用整数索引指定您想要的样本,这是真的吗?这不提供有关像素内样本位置的信息.

Is it true that the only way in OpenGL to sample a multisampled texture, i.e. a multisampled FBO color buffer, is by using texelFetch and specifying the sample you want using an integer index? This provides no information about the position of the sample within the pixel.

是否有一些参考可以提供每个样本的子像素偏移?

Is there some reference which can provide the sub-pixel offsets for each sample?

另外,位于多边形内部的碎片呢?这些不会使用所有的多样本样本:那么所有样本都包含相同的数据吗?

Also, what about fragments which lie on the inside of polygons? These will not use all of the multisample samples: Will all of the samples then contain the same data?

我试图想出一种方法来分割我的渲染场景,以便在片段着色器中单独进行后期处理.为了防止锯齿,我的分割数据也必须进行多重采样.我试图避免完全超级采样,这样我就不会使着色变得更昂贵,但尚不清楚在使用多重采样时如何在着色器中检索正确的样本.

I am trying to come up with a way to segment my rendered scene for post processing regions separately in a fragment shader. In order to prevent jaggies my segmentation data must be multisampled too. I'm trying to avoid full supersampling so that I don't make shading more expensive, but it isn't clear how I can retrieve the right samples in the shader when using multisampling.

关于多重采样如何工作的某些假设我可能不正确.也许每个样本并不真的需要有一个与之相关的位置.

I may be incorrect in certain assumptions about how multisampling works. Perhaps each sample does not really need to have a position associated with it.

也许 ARB_texture_multisample 是我需要查看的扩展?

perhaps ARB_texture_multisample is the extension I need to look at?

推荐答案

回答你的第一个问题 - 你是对的.texelFetch 不提供有关像素中的位置.AMD_sample_positions 扩展允许您以像素为单位明确设置样本位置.

Answering to your first question - you are correct. texelFetch doesn't provide about position in the pixel. There is AMD_sample_positions extension that allows you to set sample location in pixel explicitly.

这篇关于多重采样纹理采样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆