您的位置:首页 > 移动开发 > Unity3D

关于Unity3D中WebCore插件的问题

2011-09-19 15:27 429 查看
Unit3D中提供了一个叫做WebCore的插件,可以在Unity中嵌入web页面,很方便,果断下载下来尝试一把。

使用的版本是2011-4月份的dll,下图:



下载的压缩包里有这么一个文件,内容如下:



意思是说为了更好的......,UnityWebCore需要在OpenGL模式下运行,然后执行UnitWebCoreDemo.bat,而不是UnitWebCoreDemo.exe。其实UnitWebCoreDemo.bat也就是通过命令行以-force-opengl参数执行了UnitWebCoreDemo.exe。果断查文档,-force-opengl这个参数就是使unity的可执行文件以opengl方式执行。

-force-opengl (Windows only)

Make the game use OpenGL for rendering, even if Direct3D is availabe. Normally Direct3D is used; and OpenGL is used only if Direct3D 9.0c is not available.

按照说明,我分别使用opengl模式和非opengl模式运行了,都不行,求解释!!!!

1.运行UnitWebCoreDemo.bat,截图如下:



特别卡,帧率超低,而且文字(英文)也不显示了(这个是Demo中别人编辑好的exe文件,我打开工程看了下,ForceOpenGl选项是选上的)

2.运行UnitWebCoreDemo.exe,截图如下:



如同上面的说明文档一样,将会是black plane(这个就是以非-force-opengl参数运行的结果)

3.打开工程,将BForce OpenGL选项不勾选,再重新bulid,再运行,结果如下:



可以显示,但是背景是黑的,而且没有彩色,文字神马的是灰色的

4.在Unity Editor 分别勾选和不勾选BForce OpenGL,调试运行,结果如下:



和上面图唯一的区别就是有彩色了。。。。

求解释啊!!!!!

后续:

将该问题提交到Unity Community 的Forum上,http://forum.unity3d.com/threads/83071-Unity3d-plugin-for-embedding-webpages-on-WINDOWS-is-ready!/page6

回答如下:

The Editor can't be forced into OpenGL mode its always in DX, so 4 is to be expected.

The only way to performantly draw on a texture is forcing opengl which out of any halfway professional view is a big no go as it works badly and has a plentitude of problems.

you might actually want to look into the Awesonium thread where a solution for Unity is provided, it works independent of force opengl

&

The problem of it not working in the editor is not changeable at all. The editor is always in DX mode and in DX mode you can't draw on a render textuer from a plugin which is the root behind the issue you see here.

The same would happen on old intels or crappy ati drivers.

The Awesonium does not use render texture drawing from the plugin so yes it works better (and awesonium out of the box is already a game engine focused browser with some years of track record on that end)

简译:

编辑器模式下是不支持OpenGL 的,只支持DX

唯一可以实现高性能显示纹理的方式就是OpenGL模式,但是,在所有非专业版中,它都表现的不是那么好。

你可以试试Awesonium 这个玩意,他是不依附于OpenGL的。

&

在编译器模式下的这种问题是不可改变的,因为编译器总是在DX模式下渲染,而DX模式你不可以以插件渲染的方式来渲染东西,这就是所有问题的根源。

Awesonium是不用从插件中渲染材质的,所以它不会有这个问题。

看来这个Awesonium更牛叉啊,果断研究去。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: