问题标签 [msaa]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
opengl - glGetTextureHandleARB 后续 GL_TEXTURE_2D_MULTISAMPLE 错误
我想使用无绑定纹理和多重采样。但是奇怪的事情发生了。
我的纹理应该是无约束的:
//到目前为止一切顺利!
现在我创建了我的多重采样纹理,事情变得越来越奇怪:
所以,我的问题是:发生了什么?
此致
c++ - OpenGL how can I attach a depth buffer to a framebuffer using a multisampled 2d texture
How can I attach a depth-buffer to my framebufferobject when I use GL_TEXTURE_2D_MULTISAMPLE. glCheckFramebufferStatus(msaa_fbo)
from the code below returns 0. From the documentation this seems to mean that msaa_fba is not a framebuffer, but it is created from glGenFramebuffers(1, &msaa_fbo);
.
Additionally, if an error occurs, zero is returned. GL_INVALID_ENUM is generated if target is not GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER or GL_FRAMEBUFFER.
The error is 1280, which I think means GL_INVALID_ENUM.
If i remove the depth buffer attachment the program runs and renders (although without depth testing). The error is still present when it runs then. With the depth attachment included there is an error (1286) after every frame, which is INVALID_FRAMEBUFFER. I don't know how to continue from here. Some examples I've looked at do somewhat the same but seem to work.
Most of the code is from this.
EDIT
The status check was wrong, it should've been GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
. Now there is no error when I don't include the depth. When I include depth I get this error now: GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE
.
EDIT 2
Documentation claims that this happens when GL_TEXTURE_SAMPLES and GL_RENDERBUFFER:SAMPLES don't match.
GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE is returned if the value of GL_RENDERBUFFER_SAMPLES is not the same for all attached renderbuffers; if the value of GL_TEXTURE_SAMPLES is the not same for all attached textures; or, if the attached images are a mix of renderbuffers and textures, the value of GL_RENDERBUFFER_SAMPLES does not match the value of GL_TEXTURE_SAMPLES.
But they do!
I've tested them like this:
Output is:
EDIT 3
Worked around this by using two textures instead of a texture and a renderbuffer like this:
I'm am still interested in what was wrong with the original implementation, so question is still standing.
python - 单击后如何在Python中获取GUI对象的名称和值
我想记录一个 Windows 应用程序的用户场景。为此,我想在鼠标单击屏幕截图旁边的对象和鼠标位置后检索/记录 GUI 对象的对象类型、对象名称和对象值。
我一直在寻找如何做。请帮忙。
我有以下 Python 代码。
c++ - 在 OpenGL Win32 上激活多重采样
我想在 win32 API 的 OpenGL 上下文中设置 MSAA。一切正常,但 MSAA 只是不想激活。这是我构建上下文的代码:
代码工作正常,它是在主类中创建 hWnd 后调用的,而不是在 WM_CREATE 案例的 WndProc 中调用......可能有什么问题?
c++ - D3D11 渲染到纹理透明度/MSAA 问题
我已经在 Gamedev 上发布了这个,但是,已经几天了,没有被咬。我想看看是否有人知道我错过了什么。
通常我会将这些作为两个问题发布,但我感觉它们是相互交织的。简而言之,我有一个粒子系统,它为精灵生成数据以显示在透明表面上。然后将其发送到几何着色器(通过顶点着色器)以将单个顶点挤压成四边形,然后最终发送到像素着色器(下面的代码)。
像素颜色是从用作纹理图集(64x64 表面)的 32 位 DDS(使用 alpha 通道表示透明度)中采样的。
这两个问题如下:虽然单个精灵适当地尊重其透明度,但当该精灵经过另一个精灵时,其中一个四边形用透明矩形覆盖另一个四边形(您可以看到附加的图像:第一个图像是一个框架它们重叠,第二个是在一个稍微移开之后)。为了我的一生,我不能让 MSAA 合作。我已经设置了一个三重 Texture2D 系统来执行 output->ResolveSubresource->output_msaa->CopyResource->final_output,它渲染,它仍然是别名。
以下是设备、纹理和采样器状态的代码:
这是从 output_texture 转换为 output_temp 纹理以进行复制的代码:
然后这样使用:
并一点一点地复制到另一个位置进行绘图。
这是当前的像素着色器:
最后,附上显示透明剪辑的图像(有问题的精灵位于屏幕中间)。
提前谢谢大家!
更新:剪辑问题实际上是因为我们的图形艺术家和我之间的沟通不畅。纹理使用黑色作为透明的指示,而不是传统的 alpha。考虑到这一点(通过在像素着色器中将纯黑色更改为 float4(0,0,0,1))解决了裁剪问题。MSAA 问题仍然存在。
c++ - 为什么我的堆内存用完了?
所以我正在使用 Jetbrains Clion IDE 用 C++ 编写光线追踪器。当我尝试创建启用了多重采样抗锯齿的 600 * 600 图像时,内存不足。我收到此错误:
在抛出 'std::bad_alloc'
what() 的实例后调用终止:std::bad_alloc此应用程序已请求运行时以不寻常的方式终止它。请联系应用程序的支持团队以获取更多信息。
我的渲染函数代码:
宽度:600 高度:600 样本数:80
我是 C++ 的初学者,非常感谢您的帮助。我还尝试在 Microsoft Visual Studio 的 C# 中做同样的事情,内存使用量从未超过 200MB。我觉得我做错了什么。如果您想帮助我,我可以为您提供更多详细信息。
c++ - 使用 MSAA 创建交换链失败
当我尝试使用 MSAA 支持设置交换链时,我收到一个DXGI_ERROR_INVALID_CALL
错误 - 这是创建交换链的代码:
查找最佳可用 MSAA 设置的方法如下所示:
什么时候rsd.enableMSAA
一切false
都完美。
我的设备是这样创建的(我使用的是 warp 适配器,因为我没有硬件支持):
我的日志说: