VideoMaterial 在 Away3D 中显得像素化

发布于 2024-11-28 22:56:04 字数 1079 浏览 2 评论 0 原文

我正在 Away3D & 中开发球形电影查看器。当我将 VideoMaterial 纹理应用于 3D 图元时遇到问题。该视频看起来像素化严重,就像被缩放或极大压缩一样。当我应用视频中单个静态图像的 BitmapMaterial 时,它看起来很好,所以我不认为视频的分辨率是问题。

我发现[此讨论][1]通过指定“fixedHeight”和“建议解决方案”。当我调用构造函数时,“fixedWidth”,但这些争论似乎没有效果,并且 我在 API 中也找不到它们。我确实看到了一些叫做“lockH”的东西“lockW”,[在 API 中][3],但我认为它们似乎也没有任何效果。

这是构建 VideoMaterial 的代码。

//basic intro setup stuff and then...
var videoURL:String = "assets/clip.flv";
this.primitive = new Sphere({material:"blue:#cyan", radius:50000, rotationX:100, segmentsW:30, segmentsH:30});
//more code to setup the rest of the scene, and implement some texture switching, then...
this.primitive.material = new VideoMaterial({file:videoURL, lockH:1000, lockW:2000});

作为参考,我正在构建 这个示例作为起点,我使用的是 Away3D 3.6 & Eclipse Indigo 中的 Flex 4.5.1。

[1]: [3]:

I'm working on a spherical movie viewer in Away3D & am having a problem when I apply a VideoMaterial texture to a 3D primitive. The video appears heavily pixellated, like it's being scaled or hugely compressed. When I apply a BitmapMaterial of a single still image from the video it appears fine, so I don't think the resolution of the video is the problem.

I found [this discussion][1] suggesting a solution by specifying the "fixedHeight" & "fixedWidth" when I call the constructor, but those arguements seem to have no effect, and I can't find them in the API either. I do see something called "lockH" & "lockW," [in the API][3], but I they don't seem to have any effect either.

Here's the code constructing the VideoMaterial.

//basic intro setup stuff and then...
var videoURL:String = "assets/clip.flv";
this.primitive = new Sphere({material:"blue:#cyan", radius:50000, rotationX:100, segmentsW:30, segmentsH:30});
//more code to setup the rest of the scene, and implement some texture switching, then...
this.primitive.material = new VideoMaterial({file:videoURL, lockH:1000, lockW:2000});

For reference, I'm building off this example as a starting point, and I'm using Away3D 3.6 & Flex 4.5.1 in Eclipse Indigo.

[1]:
[3]:

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

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

发布评论

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

评论(2

緦唸λ蓇 2024-12-05 22:56:04

要消除像素化,请将 smooth 设置为 true。这显然不会提高分辨率,但会激活抗锯齿功能,与本机 BitmapData 上的 smoothing=true 的作用相同(在内部,这正是它的作用。 )

如果您要在全屏视图中用作环境的球体上使用视频或位图材质,则需要具有非常高分辨率的视频/位图。在任何时候,您最多只能看到球体表面的三分之一,并且它覆盖宽度超过 1000 像素的屏幕区域,因此这告诉我,您的视频需要至少 3000 像素宽,因为它不会遭受拉伸问题。

To get rid of the pixelation, set smooth to true. This will obviously not increase the resolution, but it will activate anti-aliasing, the same way that smoothing=true on a native BitmapData does (internally that's exactly what it does.)

If you are going to use a video or bitmap material on a sphere that is used as an environment in a full-screen view, you will need to have a really high resolution video/bitmap. At any one time you can only see at most a third of the sphere surface, and it covers a screen area of more than 1000 pixels in width, so that tells me that your video will need to be at least 3000 pixels wide for it not to suffer from stretch issues.

残龙傲雪 2024-12-05 22:56:04

我不敢说这是“正常”的。这主要与动作脚本代码的效率以及缺乏硬件加速和抗锯齿有关。基本上不可能将视频转换为原始视频而不造成某种质量损失,因为坦率地说,动作脚本并不是真正为这种密集计算而设计的。

尽管如此,还是有希望的。有一个新的 Flash Player 即将推出(或者我听说过),它将有一个基本的硬件加速 3D 渲染器(代号“Molehill”),Away3d 和其他 3d 引擎(如 Alternativa)已经在努力实现该渲染器。这意味着视频将被消除锯齿,因此应该是平滑的,但我无法确认这一点,因为我从未尝试过。

I'm afraid to say that this is 'normal'. It mostly has to do with the efficiency of actionscript code and the lack of hardware acceleration and anti-aliasing. It's essentially impossible to do a transform of your video onto a primitive without having some sort of loss in quality because frankly, actionscript isn't really made for this kind of intense calculations.

With that said however, there is hope. There's a new Flash Player coming out "soonish" (or so I've heard) that will have a basic hardware accelerated 3D renderer (codename "Molehill") that Away3d and other 3d engines (like Alternativa) is hard at work implementing already. This would mean that the video would then be anti-aliased and should therefor be smooth, but I can't confirm this since I've never tried.

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