如何在 iPhone 上使用 openGL 实现淡出效果?

发布于 2024-09-11 13:52:19 字数 445 浏览 6 评论 0原文

我正在使用 Apple 的 GLPaint 示例。

但我不知道如何创建一种效果,使已经绘制的东西淡出。 我在 Flash 中创建了一个示例,它显示了我正在寻找的效果: http://staging.rwichmann.com/openglexample/

在 Flash 中,我正在绘制纹理一个 BitmapData,在每一帧中,我都会向 BitmapData 添加一个 ColorTransform,从而淡出旧的绘制数据。

我想openGL中一定有类似的解决方案。与 renderBufferframeBuffer 相关的东西,但我没有找到任何解决方案。

你有什么想法、技巧、提示吗?

I'm playing around with the GLPaint Example from Apple.

But I don't know how to create an effect which fades the already drawn stuff out.
I created an example in Flash which shows the effect I'm looking for:
http://staging.rwichmann.com/openglexample/

In Flash I'm drawing a texture on a BitmapData and in every frame I'm adding a ColorTransform to the BitmapData which fades out the old drawn data.

I guess there must be a similar solution in openGL. Something with the renderBuffer or frameBuffer but I didn't find any solution.

Do you have an idea, tip, hint?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

会发光的星星闪亮亮i 2024-09-18 13:52:19

只是一个建议。与代码无关,而是与艺术相关。创建一个具有递减 alpha 值的长尾随艺术,直到艺术结束时图形变得透明。根据需要旋转和缩放以匹配主要对象的转弯和方向。这可能过于简化,但也适用于 Quartz。如果您采用 3D,则必须考虑相机的渲染方向并应用一系列类似的渐变 alpha 纹理。

抱歉,没有真正的代码可以向您展示。

此致,
纳差蓬

Just a suggestion. Not really that code related, it's art related. Create a long trailing art with diminishing alpha values until at the end of the art the graphic is transparent. Rotate and scale as necessary to match the turns and directions of the lead object. This can be overly simplified but will also work with Quartz. If you go 3D you have to consider the rendering direction to the camera and apply a similar series of fading alpha textures.

sorry, no real code to show you.

Best regards,
Natchaphon

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文