我想显示使用两个简单GLSL着色器在全窗口图像:如何找出glEnable(GL_MULTISAMPLE)是否适用于我的纹理?
顶点着色器:
#version 330
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec2 aTexCoord;
out vec3 ourColor;
out vec2 TexCoord;
void main()
{
TexCoord = aTexCoord;
gl_Position = vec4(aPos, 1.0);
}
和片段着色器:
#version 330
uniform sampler2D tex0; // loading the texture here
in vec3 TexCoord; // texture coordinates
out vec4 fColor; // fragment shader output
void main(){
fColor = texture2D(tex0,TexCoord);
}
在OpenGL的代码,OpenGL的期间属性设置,我执行
glEnable(GL_MULTISAMPLE);
我在线阅读,如果驱动程序支持,OpenGL将只执行多重采样。
反正在OpenGL中我们可以确认上面的调用是否有效? 或者有无论如何,我们可以找出我的机器显卡是否支持此调用?
我不知道这取决于驱动程序的功能。这绝对取决于渲染目标是否支持多重采样,但这与驱动程序没有直接关系。 – BDL
我被检查一些示例性代码来执行这一点,我跨越这个文件传来: [例如码(https://learnopengl.com/code_viewer.php?code=advanced/anti_aliasing_multisampling) 在该搜索** glEnable(GL_MULTISAMPLE)**。 有一个评论提及其驱动程序的基础。 有没有办法确认渲染目标是否支持多重采样? –
从第一个角度来看,我没有看到任何与你的链接中的粗体文本相似的东西。我看到的唯一说明是关于是否默认启用多重采样。如果你的窗口系统可以给你一个多采样窗口/ backbuffer和一个OpenGL上下文> 1.3,那么multisampling必须工作。 – BDL