ios - GLKit GLKVertexAttribColor : Dynamically changing colours

标签 ios opengl-es glkit eaglview texturing

所以随着物体离我越来越远,我想应用淡入淡出。 对象是有纹理的。

我相信对象的颜色是通过这条线控制的

glVertexAttribPointer(GLKVertexAttribColor, 4, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid *) offsetof(Vertex, Color));

不是从 Vertex 数组中获取颜色,而是可以向其中插入颜色吗?

我尝试设置 glColor4 等并设置

effect.useConstantColor = YES;
effect.constantColor =  self.color;

最佳答案

另一种方法是使用雾。查看 GLKBaseEffect fog property 的文档

关于ios - GLKit GLKVertexAttribColor : Dynamically changing colours,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11263639/

相关文章:

iphone - 操作无法完成。 ( cocoa 错误 1560。)

ios - 在 Swift 中使用过滤器进行高级 Firebase 查询

java - Android——在 OnDrawFrame 方法之外将 GLSurfaceView.Renderer 置于 sleep 状态(如 Thread.sleep(20))

android - 如何在 OpenGL 中使用 fragment 着色器制作更平滑的边框?

iOS GLKit,在 GLKView 中绘制文本

ios - iOS 应用程序的 otool 输出

ios - 使用 UILabel 和 UIButton 显示用户标签

iOS、FFmpeg 使用 UIimage 与 OpenGL 渲染视频

xcode - 如何在 Xcode OS X Swift Playground 中使用 GLKit?

ios - 使用 GLKit 在 OpenGL ES 2.0 中出现奇怪的混合效果