关于Unity3D中WebCore插件的问题

本文探讨了Unity3D中WebCore插件在Windows环境下使用OpenGL模式和Direct3D模式运行时遇到的问题,包括帧率降低、文字不显示等。作者通过实验发现,无论是否使用-force-opengl参数,都无法达到理想效果。社区反馈指出,Unity Editor无法强制使用OpenGL模式,且在某些情况下,Awesonium可能是一个更好的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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更牛叉啊,果断研究去。

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值