简体   繁体   English

在片段着色器中访问顶点缓冲区(缓冲区数组)

[英]accessing a vertex buffer (buffer array) in a fragment shader

Is it possible to access a vertex buffer in a fragment shader using a sampler1D in Opengl 3.0>?是否可以使用 Opengl 3.0> 中的 sampler1D 访问片段着色器中的顶点缓冲区? I think I read about it in the past, but I can't find anything about it.我想我过去读过它,但我找不到任何关于它的东西。 I can render the data to a texture, but it wouldn't be very elegant code, if a more explicit way is available.我可以将数据渲染为纹理,但如果有更明确的方式可用,它不会是非常优雅的代码。

Yes, this is called Texture Buffer Object (TBOs), it's available as a Core OpenGL feature in 3.3 (i think) or as an ARB extension, for more information check the extension specification:是的,这称为纹理缓冲区 Object(TBO),它可作为 3.3 中的核心 OpenGL 功能(我认为)或作为 ARB 扩展,有关更多信息,请查看扩展规范:

http://www.opengl.org/registry/specs/ARB/texture_buffer_object.txt http://www.opengl.org/registry/specs/ARB/texture_buffer_object.txt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM