在 Android OpenGL ES 1.1 中乘以纹理
我正在尝试在 Android 上学习 OpenGL,作为我的学习项目的一部分,我想让纹理的一部分变得透明。为了实现这一点,我得到了一个全白色的纹理,并且在我想要透明度的地方将 Alpha 通道设置为透明。我的计划是将其与我想要显示的纹理相乘,但我对缩写的函数名称和整数常量有点困惑。
有没有简单但完整的纹理乘法示例?
I'm trying to learn OpenGL on Android and as part of my learning project I want to make part of a texture transparent. To accomplish that I've got a texture that's all white with the alpha channel set to transparent where I want the transparency. My plan was to multiply this against the texture I want to display, but I'm a little boggled by the abbreviated function names and integer constants.
Any simple but complete examples with texture multiplication out there?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑:我的错,我刚刚看到您正在寻找 gl 1.0 示例
看起来您正在寻找多纹理示例: http://code.google.com/p/opengles-book-samples/source/browse/trunk/Android/Ch10_MultiTexture/src/com/openglesbook/multitexture/MultiTextureRenderer.java?r=45< /a>
这是一个 opengl es 2.0 示例。当您阅读代码时,您会发现纹理的实际混合是在片段着色器中完成的。
编辑2:我找不到 opengl-es 1.1 示例,但我有一些旧的 opengl 2.0 代码。它是用c/c++编写的,所以你必须自己将它转换为java。
我查阅了 GLES 1.1 规范,似乎它支持我的代码中的关键功能:glActiveTexture、glMultiTexCoord 和 glTexEnvi,所以这可能会帮助您入门...
EDIT: my bad, I just saw that you're looking for an gl 1.0 example
Looks like you're looking for a multi-texture example: http://code.google.com/p/opengles-book-samples/source/browse/trunk/Android/Ch10_MultiTexture/src/com/openglesbook/multitexture/MultiTextureRenderer.java?r=45
It's an opengl es 2.0 example. When you read the code, you'll see that the actual blending of the texture is done is in the fragmentshader.
EDIT 2 : I couldn't find a opengl-es 1.1 example, but I have some old opengl 2.0 code lying around. It's in c/c++, so you'll have to convert it to java yourself.
I looked up the GLES 1.1 spec, and it seems it supports the key functions from my code: glActiveTexture, glMultiTexCoord and glTexEnvi, so this may help get you started...