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

时间:2022-10-17 21:19:07

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上),着色器不是一个选项。

1 个解决方案

#1


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, i.e. its texture coordinates range from 0.0 to 1.0. This extension allows a subregion of a texture to be used as the source.
  • ARB_point_sprite使用整个源纹理来绘制点,即其纹理坐标范围从0.0到1.0。此扩展允许将纹理的子区域用作源。

#1


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, i.e. its texture coordinates range from 0.0 to 1.0. This extension allows a subregion of a texture to be used as the source.
  • ARB_point_sprite使用整个源纹理来绘制点,即其纹理坐标范围从0.0到1.0。此扩展允许将纹理的子区域用作源。