简体   繁体   English

是否可以将纹理坐标/矩阵与OpenGL点精灵一起使用?

[英]Is it possible to use texture coordinates/matrix with OpenGL point sprites?

I'm working on a particle system and point sprites would be nice to use. 我正在研究粒子系统,并且使用点精灵非常好。 Unfortunately I have a constraint that I pack ALL my textures in a single texture atlas. 不幸的是,我有一个约束,即将所有纹理打包在一个纹理地图集中。 This is a huge overall speed boost to my engine as I never have to switch texture bindings. 这极大地提高了我的引擎的速度,因为我不必切换纹理绑定。 But as a result I need to be able to specify a source texture rectangle for my particles. 但是结果是我需要能够为我的粒子指定一个源纹理矩形。

So my question: Is it possible to do this with point sprites? 所以我的问题是:是否可以使用点精灵进行此操作? From what I've read it seems like they just try to draw the whole texture. 从我阅读的内容来看,似乎他们只是尝试绘制整个纹理。

If not, my alternative is to pack vertex buffers, but point sprites would probably be faster. 如果没有,我的替代方法是打包顶点缓冲区,但是点精灵可能会更快。

I'm using OpenGL ES 1.1 (on the iPhone), shaders are not an option. 我正在使用OpenGL ES 1.1(在iPhone上),不能使用着色器。

I guess not. 我猜不会。 From the documentation on OES_draw_texture : OES_draw_texture的文档中:

(3) Doesn't ARB_point_sprite make this extension unnecessary? (3)ARB_point_sprite是否使此扩展程序不必要?

RESOLVED. 解决。 No. Key differences include: 否。主要区别包括:

  • ARB_point_sprite uses the entire source texture to paint a point, ie its texture coordinates range from 0.0 to 1.0. ARB_point_sprite使用整个源纹理绘制一个点,即其纹理坐标范围为0.0到1.0。 This extension allows a subregion of a texture to be used as the source. 此扩展允许将纹理的子区域用作源。

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

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