GPU、旧硬件、3D 加速和库
我正在编写一个 2d 库,它将具有 3d 加速,但我想以一种能够在旧硬件上有效运行的方式来实现。 可能使用 typedef 来隐藏您的目标模式不支持的选项/功能。 (也可能打开了仿真功能)
旧硬件做了哪些事情? 这是我所知道的问题和事情的清单。
- 瓷砖,这将不受支持。 它很旧,我的库将支持像素访问
- 带有滚动的单个像素缓冲区。 示例 GBA
- 多个表面,具有表面到表面快速 blt(无拉伸)
- 多个表面,具有表面到表面快速 blt,具有拉伸(也许这是模拟的?有任何 HW 拉伸图像适合您吗?)
- HW 像素填充(我想我看到了该选项DX)
- HW 透明色? (颜色是透明的,我想我在 DX 规格中看到过)
- 纹理,旧时使用的是 2 的幂。宽度不必是与高度相同的 2 的幂? (例如 64x256),是否要求它们是相同的
- 纹理,较新的硬件可以让它们具有任何宽度和高度(或者这是一个谎言?)
- 纹理可以采用疯狂的格式(ARGB 8888、ABGR 8888、ABGR 2 10 10 10 )
另外,我不能做纹理到纹理块传输? 就像在 HW 中从纹理 A 到 B 的 60x40 副本一样? 纹理也可以在调色板中吗? (我不会支持这个) 最后我应该记住着色器 8)
我还缺少什么?
i am writing a 2d lib which will have 3d acceleration but i'd like to do it in a way that it will efficiently run on older HW. Possibly typedefs to hide options/functions that your targeted mode does not support. (also there may be emulation func turned on)
What are some of the things older HW do? here is a list of questions and things i know of.
- Tiles, this will be unsupported. Its to old, my lib will support pixel access
- Single pixel buffer with scrolling. Example GBA
- multiple surface with surface to surface quick blt (no stretch)
- multiple surface with surface to surface quick blt with stretch (maybe this was emulated? does any HW stretch images for you?)
- HW pixel fill (i thought i saw the option in DX)
- HW transparent colour? (colour which is transparent, thought i seen in DX specs)
- Textures, older use to be a power of 2. The width does not have to be the same power of 2 as height? (example 64x256), does any require them to be the same
- Textures, newer HW can have them any width and height (or is this a lie?)
- Textures can be in crazy formats (ARGB 8888, ABGR 8888, ABGR 2 10 10 10)
Also, i cannot do a texture to texture blit? as in copy 60x40 from texture A to B in HW ?
Also can textures be in palette? (i wont support this)
and finally i should keep in mind about shaders 8)
What else am i missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你指的3D加速是什么? 如果是OpenGL兼容的硬件:
宽度和高度可以任意
两个的幂。
2 个约束启用
您可以测试的 openGL 扩展
对于(并且存在于几乎所有
新硬件)。
纹理格式标准化为
OpenGL,我不知道扩展
具有任意纹理格式。
关于 2D:
DirectFB 是一个值得您关注的有趣项目,它尝试大量使用硬件 2D 加速:http://www.directfb.org/。 directfb.org/
What 3D accelleration are you referring to? If it is OpenGL compatible hardware:
width and height can have arbitrary
power of two.
of 2 constraint are enabled with an
openGL extension which you can test
for (and is present on almost all
new hardware).
texture formats are standardized in
OpenGL, I don't know extensions to
have arbitrary texture formats.
About 2D:
An interesting project for you to look at could also be DirectFB, which tries to heavily use HW 2D acceleration: http://www.directfb.org/