3D 转换后文本和位图稍微模糊
我有一系列包含位图和文本的影片剪辑。 应用一些 3D 变换并在 3D 空间中移动后,我的文本和位图稍微模糊。这是在我重置所有 3d 坐标之后(即 z=0、rotationX=0、rotationY=0) 还有其他人遇到过这种情况吗?有没有办法让我恢复清晰的文本和位图?
I have a series of movieclips containing both bitmaps and text.
After applying some 3d transformations and moving in 3d space, my text and bitmaps are slightly blurred. This is AFTER I reset all the 3d coordinates (ie z=0, rotationX=0, rotationY=0)
Has anyone else encountered this? Is there a solution to get my crisp text and bitmaps back?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是一个非常有趣的错误。
出现的模糊实际上是不正确的抗锯齿或平滑处理,通常通过沿边缘渲染具有精细颜色的字体来解决。在这种情况下,它实际上是由 3D 转换引起的,可以通过在动画之后取消
matrix3D
来解决:您也可以编写:
但使用这种方法,您必须导入
flash .geom.Matrix
。这两个选项还会将
x
和y
坐标以及动画显示对象的其他重要设置重置为零,因此您还必须分配这些值赋给变量并在使变换矩阵无效后重新应用它们。似乎一旦字体被变换,它就失去了这种精细的色彩。未转换的字体具有这些颜色细节,而转换的字体则完全不饱和。
附件是 12 点字体的放大细节,显示了颜色细节的损失。顶部的字符串没有 3D 变换,而底部的字符串通过
rotationY
动画到舞台上。这里是同一张图像,饱和度为 90%,以更清楚地显示颜色:
这些颜色细节在灰色文本上更容易看到。
我相信自从 Flash Player 9 / AVM2 首次推出以来,这个错误就一直存在。此外,在早期版本的 Flash 播放器中,正确渲染的字体周围的精细颜色细节更加饱和,在我看来,这使字体看起来更好 - 尽管对于像我这样的非完美主义者来说,这种差异可以忽略不计。
this is a very interesting error.
the blur that appears is actually improper anti-aliasing, or smoothing that is usually solved by rendering the font with fine colors along the edges. in this case, it is in fact caused by 3D transformations and can be solved by nullifying the
matrix3D
after the animation:you could also write:
but with this approach you'll have to import
flash.geom.Matrix
.both options will also reset to zero the
x
andy
coordinates, and possibly other important settings of the animated display object, so you'll also have to assign those values to variables and reapply them after nullifying the transform matrix.it seems that once a font is transformed, it loses this fine color tinting. non transformed fonts have these color details while transformed fonts become completely desaturated.
attached is a zoomed in detail of 12 point font which exhibits this loss of color detail. the top string has no 3D transformation while the bottom string was animated onto the stage via
rotationY
.here is the same image saturated to 90% to show the colors more clearly:
these color details are easier to see on grey text.
i believe this error has been present since Flash Player 9 / AVM2 was first introduced. additionally, the fine color detail around the properly rendered font was much more saturated in early versions of the Flash player, which, in my opinion, made the fonts look much better - although the difference could be considered negligible by non perfectionists unlike myself.
您需要确保在已应用 3D 变换的任何对象上将 matrix3D 属性设置为 null。
You need to make sure you set the matrix3D property to null on any objects that you've applied 3D transformation to.
查找有关 3d 问题的另一篇文章并找到了解决方案。
您需要通过应用新的 transfrom.matrix 来删除所有 3d 变换
var tempMatrix:Matrix = new Matrix();
this.transform.matrix = tempMatrix;
Looking up another post on 3d issues and came across the solution.
You need to remove all 3d transformations by applying a new transfrom.matrix
var tempMatrix:Matrix = new Matrix();
this.transform.matrix = tempMatrix;
更好的答案是使用此修复程序。这是我以前一直使用的一个。
该函数设置稍微偏移的scaleX和scaleY。这看起来很奇怪,但是当您使用任何 3D 属性对对象进行 3D 调整时,它可以防止它看起来模糊。您始终可以删除 3DTransform,但有时您需要将其保留在原处。
我将此函数放在我拥有的 Utilities3D 类上。
An Even better answer is to use this fix. It's one I used to use all the time.
This function sets a slightly offset scaleX and scaleY. It seems weird, but they when you make 3d adjustments to the object using any 3d property it keep it from looking blurry. You can always remove the 3DTransform, but sometimes you need it to stay in place.
I place this function on a Utilities3D class I have.