如何使盒子的边缘平滑没有抗锯齿? [英] How can I make a box's edges smooth without anti-aliasing?

查看:222
本文介绍了如何使盒子的边缘平滑没有抗锯齿?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为iPhone制作一个骰子游戏。我使用SIO2作为引擎,但我认为这个问题是更一般的OpenGL相关的。

I'm creating a dice game for the iPhone. I'm using SIO2 as engine, but I think this question is more general OpenGL-related.

由于iPhone缺少对抗锯齿的支持,我的骰子看起来有点尖锐。如果可能,我想让模具的边缘圆润和光滑,而不是锋利。我找到一个应用程序,MotionX,管理这样做,我想没有使用反锯齿。请参阅此处的屏幕截图。如果你仔细观察骰子边缘,你会看到有一个从明亮的顶面到阴影的侧面的浮动过渡。

Since the iPhone lacks support for anti-aliasing, my dice looks kind of edgy. If possible, I'd like to make the edges of the die rounded and smooth instead of sharp. I've found one app, MotionX, that manages to do this, and I think without using anti-aliasing. See screenshot here. If you look closely at the dice edges, you see there is a floating transition from the brightly lit top face to the shadowed side face. This looks kind of round from far away.

有没有人知道如何重现这样的效果?

Does anyone know how to recreate such an effect?

推荐答案


如果你仔细观察骰子边缘,你会看到从明亮的顶面到阴影的侧面有一个浮动的过渡

If you look closely at the dice edges, you see there is a floating transition from the brightly lit top face to the shadowed side face

不确定iPhone是否支持此功能,但您可以使用正常地图实现此效果:

Not sure if the iPhone supports this, but you may be able to achieve this effect with a normal map:

http://en.wikipedia.org/wiki/Normal_mapping

当然,你需要截断角,使它们足够圆,以便法线贴图可以帮你完成其余的操作。

Of course, you'll need to truncate the corners to get them sufficiently round enough that the normal map will get you the rest of the way.

这篇关于如何使盒子的边缘平滑没有抗锯齿?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆