- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 viewport
是 screen size/framebuffer
的一半。
x, y, w, h = 0, 0, 512, 512
我的 scissor
区域是完整的 framebuffer
x, y, w, h = 0, 0, 0 1024, 512
我正在画一条线,它远离viewport
,从左到右。我希望这条线只在视口(viewport)内绘制。我已经在三 block 不同的显卡上对此进行了测试,在其中两 block 上,我得到了我期望的结果。但是在第三个上,线绘制在 viewport
之外,但在 scissor
区域内。哪一个结果是正确的?据我了解,线的两个顶点应该移动到外部 viewport
位置。它不应该画在它外面。
如果您阅读本网站上的陷阱 nr 10
: https://www.opengl.org/archives/resources/features/KilgardTechniques/oglpitfall/
他们正在谈论在视口(viewport)
之外绘制,但这只是一些特殊情况,例如你有一条非常粗的线,我的线宽是1
>/p>
最佳答案
编辑:在 KhronosGroup 的讨论之后:来自规范 Vulkan 1.0.68:
If either of a line segment’s vertices lie outside of the clip volume, the line segment may be clipped, with new vertex coordinates computed for each vertex that lies outside the clip volume. A clipped line segment endpoint lies on both the original line segment and the boundary of the clip volume.
英伟达:
We intentionally made this change for maintenance2, to allow for pop-free points and lines. Point clipping behavior is queriable but line clipping behavior is not, though I believe the "preferred" behavior for lines is to be pop-free. We changed the NVIDIA driver last year from tight clipping to pop-free, and even changed CTS tests to allow this new behavior. So this is all working as designed.
旧答案:
视口(viewport)定义了从标准化设备坐标到窗口坐标的转换。视口(viewport)变换不进行任何裁剪。
但是,裁剪确实发生在 NDC
空间之前,视锥体裁剪确实保证没有顶点可以落在视口(viewport)之外。如果您使用正交投影,剪辑空间和 NDC
空间是相同的。所以 [-1,1]
之外的所有内容都将被剪裁。如果你没有做任何特殊情况,opengl 链接会讨论顶点应该被剪裁。
如果您的两张显卡在视口(viewport)内绘制,一张在视口(viewport)外绘制,则可能是驱动程序错误。如果您使用的是相当新的 Vulkan,则很可能是这种情况。
关于opengl - 在 Vulkan/Opengl 的视口(viewport)外绘图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48510072/
我想知道为什么可以在 VkPipelineLayoutCreateInfo 中指定多个描述符集布局,因为一个已经包含所有绑定(bind)。 最佳答案 描述符集布局描述了单个描述符集的布局。但是一个管道
我试图了解整个 L1/L2 冲洗是如何工作的。假设我有一个像这样的计算着色器 layout(std430, set = 0, binding = 2) buffer Particles{ Pa
Vulkan 旨在为用户提供精简和明确的内容,但队列是此规则的一个很大异常(exception):队列可能由驱动程序复用,并且使用一个系列的多个队列是否会提高性能并不总是很明显。 在驱动程序更新之一之
来自与 vkCmdPipelineBarrier 相关的规范: If no memory barriers are specified, then the first access scope inc
Vulkan 是否提供绘制基本图元的功能?点、线、矩形、实心矩形、圆角矩形、实心圆角矩形、圆、实心圆等。 ? 我认为没有任何 VkCmdDraw* 命令可以提供此功能。如果这是真的,需要做些什么来绘制
我正在尝试进行一个模拟,该模拟涉及渲染前的两个计算步骤。我目前有一个计算基础物理的计算管道,然后是一个图形管道。我希望能够添加第二个计算着色器以在第一个计算着色器之后运行。 首先,Vulkan 中是否
取消映射后可以刷新内存范围吗? 乍一看好像不对,因为函数叫vkFlushMappedMemoryRanges() ,但是 the documentation似乎暗示内存已准备好刷新,即使在未映射之后:
Vulkan 是否支持保存流水线阶段的顶点输出?我一直在寻找,但找不到任何示例或引用资料,也许其他人不知道? 最佳答案 Transform Feedback 在最初的 Vulkan 版本中没有被削减,
我有多个具有不同纹理/管道构造的网格,例如深度测试/混合函数以使用 vulkan 进行渲染。在性能方面呈现它们的最佳实践是什么。 一种选择是为 n 个网格创建 n 个具有 n 个线程的命令缓冲区,它们
我正在开发一个使用 Vulkan 的 C++ 应用程序。我如何获得支持的扩展集? 像std::set get_supported_extensions()这样的签名会很理想。 最佳答案 vkEnume
我正在开发一个使用 Vulkan 的 C++ 应用程序。我如何获得支持的扩展集? 像std::set get_supported_extensions()这样的签名会很理想。 最佳答案 vkEnume
正在处理 Vulkan 三角形渲染代码,我想将渲染图像保存到文件而不是渲染到窗口。 那么我应该什么时候读取帧缓冲区以及如何编写在文件中。我想需要将原始 RGBA 格式的像素转换为某种已知的 BMP 或
Vulkan 规范(1.0.12)在第 2.4 节介绍了 VkDeviceSize: With few exceptions, Vulkan uses the standard C types for
即使实例在 Vulkan 中创建失败,我是否应该销毁它? 哪个是正确的: 1: VkResult Result = vkCreateInstance( info, NULL, instance );
我开始学习 Vulkan,想知道 VkCreate[...] 函数是否将结构中指向的资源复制到他自己的缓冲区中。 为了澄清我的问题,在这段代码中我加载了 斯皮尔 将着色器放入我自己的 mkShader
Khronos 刚刚发布了他们的新内存模型扩展,但还没有进行非正式讨论、示例实现等,所以我对基本细节感到困惑。 https://www.khronos.org/blog/vulkan-has-just
SubpassInput 由片段着色器隐式寻址。我想用我自己的纹理坐标来处理输入。类似于 texture(sampler, texCoord) 最佳答案 这是不可能的。如果您想在着色器内对图像进行采样
有没有办法从实例中获取对象类型枚举器(vk::ObjectType dor vulkan.hpp 和 VkObjectType for vulkan)? 例如假设我们有 3 个对象: vk::Devi
我的着色器索引到采样器和图像,但是当我从图像中采样时(如果我在着色器中采样,我只会得到错误)我得到一个错误: Descriptor in binding #0 index 0 requires FLO
我想到了以下场景,但我不知道它是否有效: 在程序的开头创建一个VkCommandPool,并从中分配一个VkCommandBuffer。 在渲染循环中,将命令记录到 VkCommandBuffer(隐
我是一名优秀的程序员,十分优秀!