我有一个来自这个PNG的纹理:
另一个来自这个PNG:
它们都有相同的混合函数:
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
我想先在一个多边形上看到它们。我只是找不到一个简单的 混合函数这方面的例子。将它们绘制到不同的多边形效果很完美,但我只是无法将它们“合并”成一个纹理。任何工作示例代码线将不胜感激。
第二个问题是制作镜面反射贴图的 alpha 变量。我可以看到我必须以某种方式将 alpha 与原色(从我的变量创建)进行纹理组合,但同样,没有代码的工作示例。我开始研究glTexEnvi函数,但还没有任何结果。
拜托,我求你只需要大约 16 行代码!我用 google 搜索了整个网络,但仍然卡住了。
我想要实现的引擎(帖子底部的工作Flash草图)是此处。
I have a texture from this PNG:
And another from this PNG:
They both have the same blend function:
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
I want to see them on one single polygon first. I just couldn't find a simple example of this. Draw them to different polygons works perfect, but I just cannot "merge" them into one texture. Any working sample codelines would be appreciated well.
Second problem is to make the specular map's alpha variable. I can see that I have to texture combine somehow it's alpha with the primary color (created from my variable), but again, have no working example of codes. I began to study glTexEnvi function, but yet I have no any result.
Please, I beg you for just about 16 lines of code! I googled the whole net, but still stuck.
The engine I want to implement (working flash sketch on the bottom of the post) is here.
发布评论
评论(1)
我不知道您需要的确切代码行,但似乎您使用 glTexEnv 走在正确的道路上...这个 关于 opengles 1.1 的书对此进行了一些讨论。我认为你想要的是纹理组合器:
我不知道这是否能实现你想要的,但你可能仍然需要 FBO 来正确完成它。
I don't know the exact lines of code that you need, but it seems that you were on the right path with glTexEnv... This book on opengles 1.1 talks about it some. I think what you want are texture combiners:
I don't know if this will accomplish what you want though, you may still need the FBOs to do it right.