Multisample texture sampling

杀马特。学长 韩版系。学妹 提交于 2020-01-06 03:27:24

问题


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.

Edit: 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.

perhaps ARB_texture_multisample is the extension I need to look at?


回答1:


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.



来源:https://stackoverflow.com/questions/9166350/multisample-texture-sampling

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!