求教关于unity中D3D fullscreenmode mode修改问题

今天看啥 热点:
unity3d 基于物理渲染的问题解决,unity3d渲染
【狗刨学习网】
最近1个月做了unity 次世代开发的一些程序方面的支持工作,当然也是基于物理渲染相关的,主要还是skyshop
marmoset的使用吧,他算是unity4.x版本 PBR的优秀方案之一了
但在使用以及性能上,还是多少有些坑和不足,这里也是自己的一些心得吧,希望可以其他对这个方案有兴趣的朋友起到一些帮助。
一、遇到了fps降低的BUG
国庆节前的老版本工程和最新的工程版本运行起来没任何区别,但新版本在真机上的的运行效率有问题,只有7.5fps
开发和运行环境,
XCode6.1 IOS8.1&
IPad Air 分辨率
Graphic level GLES 3.0
图1 老版本的运行截图,为了能做参考,我这里把新版本的场景文件拷贝到老工程里
新版本相同的场景就只有不到8FPS
然后对两个版本用Xcode做了分析,旧版本fps analyze
新版本fps analyze,同样的shader消费的ms是老版的5倍
发现bug后,尝试定位问题&
1 一开始认为是marmoset版本问题,但用老版本完全覆盖,fps并没有提升&
2 删除和场景资源相关外的所有资源,重新build后,fps就恢复了,不过这种解决方法应该是无非接受的
目前临时的解决方法,把老工程的ProjectSettings里的文件替换过好了,具体的原因还要继续排查。
另外有一些版本的SkyShop的Mobile
shader没有gles3.0的支持,需要在给所有场景里使用的Marmoset的shader里添加关键字
#pragma surface MarmosetSurf MarmosetDirect vertex:MarmosetVert exclude_path:prepass noforwardadd approxview
#pragma only_renderers d3d9 opengl gles d3d11 d3d11_9x&gles3
好早marmoset的是UberShader的设计,所以只要改几个就好了。
要unity支持es3.0的话,需要在设置Player Settings.. 的图形等级里选择 Automatic或强制gles3.0。
如果只用es2.0的话,因为unity会使用texCube或texCubeBias来替换texCubeLod,没有lod的支持,使用cubemap的mipmap来实现粗糙度的功能就会受到影响
最终渲染画面里可能会看不到材质的粗糙度表现。
如果把这个bug解决的话,那么性能评估应该和10.1前的报告一样,IPad
Air 可以承受的是全屏,100Draw Call的支持IBL材质物体的绘制,另外有IBL的shader的瓶颈
应该是在pixel shader上,如果1,2个IBL材质占满整个屏幕的话,一样会有潜在的瓶颈问题产生。
二、关于另外一个场景的问题解决
Draw Call可以先在Editor或联机Porfile里查看,一些设备不支持Unity
Editor的GPU Profile,所以还是要用到Xcode
没做任何优化的前提下 draw call是592,
GPU里两个占用最高的shader,9.8ms和7.94ms都是Terrain占用的(地形和他和阴影贴图),另外关闭阴影后为289
drawcall,关闭地形后289-&219(地形 70dc),关闭水面289dc-&246dc(水面反射)
首先是Terrain,不论是shader还是dc都有些多,在Xcode的Frame
view里,Terrain的绘制有不合理的地方,从截图场景来看,这种大小的地形需要70的draw call次数有些夸张了,另外就是shader上,如果是静态烘培阴影,应该是可以合并到一个shader里绘制的。建议还是从优化地形开始,降低dc,合并shader,如果u3d 的terrain没有优化的可能,不如就直接max里制作网格的地面来代替。
水面可以优化反射部分的实现,静态场景的反射可以预烘培到一张贴图里,而可以反射的部分,建议单独添加到一个layer里。降低dc数量。摄像机的可视范围,角度,以及shader
Lod的设置,在Xcode的分析中,一些极远位置的山体还是被绘制了,而且和近处的角色一样高质量的shader,这点用unity的内部设置应该就可以解决。另外这个demo摄像机的角度过低,导致远处的物体也都被渲染到,如果适当修改摄像机角度,例如传统的45视角,应该可以裁剪一部分场景物体。起到降低dc和ps填充率的作用。
三、关于Marmoset
shader的改进意见
1。如果不使用skyshop的天空盒的动态功能的话,skymanager的update可以关闭
public void LateUpdate()
& && && && &if(firstFrame) {
& && && && && & if(_GlobalSky) {
& && && && && && &&&firstFrame =
& && && && && && &&&_GlobalSky.Apply(0);
& && && && && && &&&_GlobalSky.Apply(1);
& && && && && && &&&if(_SkyboxMaterial) {
& && && && && && && && &_GlobalSky.Apply(_SkyboxMaterial, 0);
& && && && && && && && &_GlobalSky.Apply(_SkyboxMaterial, 1);
& && && && && && &&&}
& && && && && & }
& && && && &}
& && && && &#if UNITY_EDITOR
& && && && &if(!Application.isPlaying)
& && && && &#endif
直接在 #if UNITY_EDITOR前面返回return就可以了,这样可以节省skymanager的Update的cpu消耗和GC。
2 GlossyMap的使用,之前为了解决7FPS的问题时,尝试的一种解决方案,在Anylaze里直接修改textureLod的参数
tmpvar_40 = textureLod
(_SpecCubeIBL, lookup_38.xyz, lookup_38.w);
tmpvar_40 = textureLod
(_SpecCubeIBL, lookup_38.xyz, 1);,
这样效率可以提高1倍以上
分析可以看下图
highp float glossLod_36;
&&glossLod_36 = tmpvar_27;
&&mediump vec4 spec_37;
&&mediump vec4 lookup_38;
&&highp vec4 tmpvar_39;
&&tmpvar_39.xyz = ((v_33.xyz * tmpvar_32.x) + ((v_34.xyz * tmpvar_32.y) + (v_35.xyz * tmpvar_32.z)));
&&tmpvar_39.w = glossLod_36;
&&lookup_38 = tmpvar_39;
&&lowp vec4 tmpvar_40;
&&tmpvar_40 = textureLod (_SpecCubeIBL, lookup_38.xyz, lookup_38.w);
上面是还没有做任何修改的shader,lod,也就是lookup_38.w还是根据glossy
map的值,在shader里计算得出
&&tmpvar_39.w = glossLod_36;
&&lookup_38 = tmpvar_39;
&&lowp vec4 tmpvar_40;
&&tmpvar_40 = textureLod (_SpecCubeIBL, lookup_38.xyz, 1.0);
在shader里直接传一个const值的方法,热更新后可以看到shader消费的ms和之前有一定的减少。
不过重新启动游戏的话,ms有了40%左右的减少,这是因为IOS做的优化,如果lod在shader运行前已经确定的话,会直接pre
fetch制定的texture,就不需要在每个pix shader里重新执行一次采样了。&
所以,glossy map建议适量使用,一些不需要细节的材质可以直接用一个恒定的roughness参数替代。
还有就是关于pbr shader算法的优化,marmoset自己内部有MARMO_HQ的关键字,通过切换可以实现一定程度的优化,先是两种质量的对比
MARMO_HQ 差别在shader的精确度上,以及出射光的亮度上
MARMO_HQ的用处,对向量的规格化,起到类似能量守恒的作用,Fresenl函数的算法选择,使得渲染的出射光总量更符合物理效果
//self-shadowing blinn
#ifdef MARMO_DIFFUSE_DIRECT
& & spec *= saturate(10.0*dp);
& & spec *= saturate(10.0*dot(N,L));
#ifdef MARMO_DIFFUSE_DIRECT
& & spec *= saturate(10.0*dp);
& & spec *= saturate(10.0*dot(N,L));
#ifdef MARMO_HQ
& & localN = normalize(localN);
#endif& &&
以上是shader代码里一些规格化设置的样本。
shader里还有其他一些可优化点
&&例如Specular Intensity,Sharpenss,fresnel Strength,并不是pbr Material的标准参数,一般只需要roughness或glossy map里选择其一做粗糙度参数就可以 .而其他参数去掉可以减少一部分shader的计算量
&&前面提到的glossymap和roughness的切换,需要shader支持,编辑器也要做一定的修改。
fresenl 反射方程,marmoset提供了的
splineFresnel和fastFresnel的两种方法,但实际的计算量还是比较多,根据GDC2014上的unity5的方案,可以换成简单的pow 4次方的形式。 确定TextureCubeLod的方向和lod值的算法上也优化的空间。
&&UberShader的设计是一个优点,在开发的时候可以减少很大的工作量,实际运行时,创建和编译shader数量也很少,方便分析和定位shader的问题,和在Xcode里进行优化调试。
&&另外就是marmoset的skymanager部分,还是需要修改的,他本来的设计目的是基于天空盒来生成IBL使用的Cubemap,而真正的IBL光照是基于周围环境来生成,所以,skyshop这种整个场景统一一张cubemap的方法,在真实性和效果上还是很值得斟酌的,它的IBL的生成和管理接口对做游戏来说也不是很方便,优点就是它提供了编辑器和cumbemap生成部分的全部代码,不论是扩展还是修改bug,都是可行的。
&&unity4.x的版本里,在移动端是无法支持延迟渲染方法的,所以对场景里的光源限制会比较严格,一盏方向光就是极限了,其他烘托场景的用的点光源,就只能使用lightmap了
而lightmap的具体算法,也是要用户自己实现的,Marmoset在MarmosetDirect.cginc里实现了directional lightmap lighting的实现,LightingMarmosetDirect_DirLightmap 这个的命名是要按照unity custom shader的规范来命名,就可以在unity渲染管线里自动被识别,如果想优化,或者要支持Dual lightmap等其他类型的liaghtmap,最好还是自己提供优化的方法。希望我们自己的项目里,将来能提供TBDR的支持来达到大量光源的支持。
最后考虑还是要和UE4的移动产品做一下竞品对比的:
UE4的Sum Temple项目是个很好的参考,gles2.0的图形规格下,也能获得很好的效果
UE4 mobile的图形规格,简单来说就是一个Directional
light+distance shadow来生成光照和阴影,其他的场景明暗和各种颜色灯光的亮度由lightmap来实现,IBL方面,可以为通过设置RefelctCapture,给制定区域内的对象生成IBL,同一场景内可以使用多个cubemap的实现(ppt里说他在移动端是使用了一个统一的cubemap,这点需要后面直接对它的工程做真机剖析了)。另外也有bloom+AA+light
shaft+dof等的后处理效果,但因为图形规格的限制,ES2.0版本是没有真实HDR的支持的。
接下来我会准备一篇针对UE4渲染和优化方法的分析。
&&通过这次U3D的PBR的实验,在IPAD
Air和K1这种硬件级别的机器上,制作PBR的游戏还是没有问题的,一开始担心视网膜屏的填充率问题,在实际测试中,还是可行的,但需要整个开发团队有一定的优化意识,才能在整个上保证一个良好的运行效率,比如支持IBL的分配,而且游戏制作方面,也要考虑什么样的游戏类型,才能发挥PBR渲染的优势,特别是间接照明对游戏场景品质的提升(消费最高的IBLshader支持的是间接照明的高光部分)。还有就是多使用unity的batch功能,尽量降低dc和关于shader状态切换等等,另外可惜的是,因为之前7fps bug的问题,这次没有时间把unity的post
effect部分实现,个人考虑是可以把ue4的这部分实现移植过来, UE4对U3D可以起到很好的竞品作用,在今后的PBR效果和效率的测试和优化中,一定的对比分析和借鉴,也是很有帮助的。
声明:此篇文档时来自于【狗刨学习网】社区,是网友自行发布的Unity3D学习文章,如果有什么内容侵犯了你的相关权益,请与官方沟通,我们会即时处理。
更多精彩内容:
相关搜索:
相关阅读:
相关频道:
Android教程最近更新Unity3D(11)
【准备工作】
在Unity3D中想要成功播放视频并不是一件太简单的事,还是有着诸多限制的。
要求如下:
(1) 视频。格式支持 .mov, .mpg, .mpeg, .mp4, .avi, .asf 等,视频的大小最好别超过 100MB,因为 Unity3D 对视频的导入是比较慢的(也可能是亦泽的电脑已经 out 了…);
(2) 在Windows上导入影片需要QuickTime播放器,没有的可以从这里下载
做好准备工作后,便可以使用下面的方法来播放视频了!
【Material】
  使用 MovieTexture 类。将影片作为 MovieTexture 类型的对象。MovieTexture 类继承自 Texture 类,所以可以使用 material(材质球)对影片进行渲染。
(1) 创建一个新的 material 资源文件并将其重命名为 “MovieMaterial”,并将其 shader 属性改为 Unlit/Texture,即不受光照影响的材质;
(2) 在场景中创建 Plane,调整其大小和位置,使其 xoy 面正对着摄像机;
(3) 将 MovieMaterial 替换 Plane 的 Mesh Renderer 组件中 Materials 属性中的 Default-Material;
(4) 创建脚本PlayMovieByMaterial,附加给 Plane,并添加如下代码:
using UnityE
public class PlayMovieByMaterial : MonoBehaviour
public MovieTexture _M
void Start()
GetComponent&Renderer&().material.mainTexture = _M
_Movie.Play();
(5) 将影片指定其 Movie 属性,此时播放,会发现没有声音;
(6) 为 Plane 添加 AudioSource 组件,将影片资源附带的声音资源指定给其 AudioClip 属性;
(7) 运行,即可在 Plane 上渲染出影片。
【UGUI RawImage】
  原理与使用 material 类似,都是将 MovieTexture 作为 Texture 来渲染影片。在使用 UGUI 时,肯定不能用 Plane 来播放影片,那也太诡异了- -。UGUI 提供了 RawImage 组件,与 Image 组件不同的是,它含有的是 Texture 类型的属性,可以利用此属性渲染影片。
(1) 创建 RawImage;
(2) 创建脚本PlayMovieByMaterial,附加给 RawImage,并添加如下代码:
using UnityE
using UnityEngine.UI;
public class PlayMovieByRawImage : MonoBehaviour {
public MovieTexture _M
void Start ()
GetComponent&RawImage&().texture = _M
_Movie.Play();
(3) 将影片指定其 Movie属性,此时播放,会发现没有声音;
(4) 为 Plane 添加 AudioSource 组件,将影片资源附带的声音资源指定给其 AudioClip 属性;
(5) 运行,即可在 RawImage 上渲染出影片。
【移动平台】
  上述两种方法都不能在移动端播放影片,在你打包时你会发现 Unity 会提示你类似于“没有发现 Movie Texture 类型”这样的错误,这是因为移动平台不支持这个类。所以我们需要用到 Handheld.PlayFullScreenMovie 方法来实现移动平台上视频的播放。移动平台支持 .mov, .mp4, .mpv, and .3gp 四种格式视频。  
  Handheld.PlayFullScreenMovie 方法专用于移动平台(IOS,Android)播放视频,在视频播放时,Unity会暂停运行,直至视频结束。也就是说当视频结束后,才会开始执行这行代码的下一行代码。
Handheld.PlayFullScreenMovie 方法共有四个重载方法,这里分别介绍一下每个参数:
表示文件的路径。需要加载的影片必须放在 Assets/ StreamingAssets/
路径下,此路径作为影片文件的根目录,若无子目录,则直接通过“Movie.mp4”文件名来表示 Movie 文件的路径。
表示背景颜色。通常指定为 Color.black。
controlMode:
表示视频的控制模式,此为 FullScreenMovieControlMode 类型的结构体,共四个成员:
FullScreenMovieControlMode.Full 表示播放视频时应用完整的视频控制器,如进度条、暂停等;
FullScreenMovieControlMode.Minimal 表示播放视频时应用最简的视频控制器;
FullScreenMovieControlMode.CancelOnInput 表示播放视频时点击屏幕即关闭视频;
FullScreenMovieControlMode.Hidden 表示不接受任何控制,直到视频播放完成。
scalingMode:
表示视频的缩放模式,此为 FullScreenMovieScalingMode 类型的结构体,共有四个成员:
FullScreenMovieScalingMode.None 不缩放该视频;
FullScreenMovieScalingMode.AspectFit 缩放视频直到尺寸适合屏幕;
FullScreenMovieScalingMode.AspectFill 缩放视频直到视频填充整个屏幕;
FullScreenMovieScalingMode.Fill 缩放视频直到长宽完全适合屏幕。
只需要调用此方法即可播放影片(需要在移动平台测试):
using UnityE
public class PlayMovieOnMoblie : MonoBehaviour {
void Start ()
Handheld.PlayFullScreenMovie("Movie.mp4", Color.black, FullScreenMovieControlMode.CancelOnInput);
【无法播放影片的解决方案】
(1) 使用 QuickTime 播放影片后再将其导入,如不行,重启后再进行尝试;
(2) 影片的格式必须是真实的格式,不能是手动改后缀得到的(亦泽曾天真的试过),如果格式没问题还是播放不了,使用视频转码器转码成 .mp4 格式后再导入进行尝试。
【参考资料】
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:5372次
排名:千里之外
原创:19篇
(1)(8)(8)(1)(1)Unity - Manual: Standalone Player Settings
Version: 5.6 ()
Language: English
Standalone Player Settings
Standalone
Multi-display
Other VersionsCannot access other versions offline!
Standalone Player Settings
This page details the Player Settings specific to standalone platforms (Mac OSX, Windows and Linux). A description of the general Player Settings can be found .
Resolution And Presentation
Resolution
Default is Full Screen
Check this box to make the game start in fullscreen mode by default.
Default Is Native Resolution
Check this box to make the game use the default resolution used on the target machine.
Default Screen Width
Default width of the game screen in pixels.
Default Screen Height
Default height of the game screen in pixels.
Run in background
Check this box to make the game keep running (rather than pausing) if the app loses focus.
Standalone Player Options
Capture Single Screen
Check this box to ensure standalone games in fullscreen mode do not darken the secondary monitor in multi-monitor setups. This is not supported on Mac OS X.
Display Resolution Dialog
Choose whether the game should start with a dialog to let the user choose the screen resolution. The options are Disabled, Enabled and Hidden by Default (i.e. the option only appears if the alt key is held down at startup).
Use Player Log
Check this box to write a log file with debugging information. If you plan to submit your application to the Mac App Store, leave this option un-ticked. Ticked is the default.
Resizable Window
Check this box to allow the user to resize the standalone player window.
Mac App Store Validation
Check this box to enable receipt validation for the Mac App Store.
Mac Fullscreen Mode
Choose how fullscreen mode operate on MacOSX. The options are Capture Display (i.e. Unity takes over the whole display and the user cannot switch apps until fullscreen mode is exited), Fullscreen Window and Fullscreen Window with Menu Bar and Dock.
D3D9 FullScreen Mode
Choose the fullscreen mode when using DirectX 9.
Exclusive Mode
Sets the Default Fullscreen mode to encompass the whole screen without a window surrounding it.
Fullscreen Window
Keeps the game in a window when in fullscreen. Better for allowing the game to run in the background.
Exclusive Mode
Sets the Default Fullscreen mode to encompass the whole screen without a window surrounding it.
Fullscreen Window
Keeps the game in a window when in fullscreen. Better for allowing the game to run in the background.
Visible in Background
Check this box to show the application in the background if Fullscreen Windowed mode is used (in Windows).
Force Single Instance
Check this box to restrict standalone players to a single concurrent running instance.
Supported Aspect Ratios
Choose the aspect ratios that appear in the Resolution Dialog at startup (as long as they are supported by the user’s monitor).
Override for Standalone
Check this box to assign a custom icon to be used for your standalone game. Upload different sizes of the icon to fit each of the squares below the checkbox.
Splash Image
Config Dialog Banner
Add a custom splash image to be displayed in the Display Resolution Dialog.
Show Unity Splash Screen
Shows the “Made with Unity” Splash Screen when the game is loading .
Other Settings
Color Space
Choose which color space should be used for rendering. The options are Gamma and Linear. See the Unity Manual page on
for a guide to the difference between the two.
Auto Graphics API for Windows
Check this box to use the best Graphics API on the Windows machine the game is running on. Uncheck it to add and remove supported Graphics APIs.
Auto Graphics API for Mac
Check this box to use the best Graphics API on the Mac the game is running on. Uncheck it to add and remove supported Graphics APIs.
Auto Graphics API for Linux
Check this box to use the best Graphics API on the Linux machine it runs on. Uncheck it to add and remove supported Graphics APIs.
Static Batching
Check this box to use Static batching.
Dynamic Batching
Check this box to use Dynamic Batching (activated by default).
GPU Skinning
Check this box to enable DX11/ES3 GPU skinning.
Graphics Jobs (Experimental)
Check this box to instruct Unity to offload graphics tasks (render loops) to worker threads running on other CPU cores. This is intended to reduce the time spent in Camera.Render on the main thread, which is often a bottleneck. Please note that this feature is experimental. it may not deliver a performance improvement for your project, and may introduce new crashes.
Virtual Reality Supported
Check this box when building a Virtual Reality application. See
for more information.
Configuration
Scripting Backend
Mono2x is the only scripting backend supported on Standalone platforms.
Disable HW Statistics
Check this box to instruct the application not to send information about the hardware to Unity (See the
page for more details).
Scripting Define Symbols
use this to set custom compilation flags (see the
page for more details).
Optimization
API Compatibility Level
There are two options for API compatibility level: .Net 2.0, or .Net 2.0 Subset.
.Net 2.0 libraries. Maximum .net compatibility, biggest file sizes.
.Net 2.0 Subset
Subset of full .net compatibility, smaller file sizes.
Prebake Collision Meshes
Check this box to add collision data to meshes at build time.
Preload Shaders
Check this box to load shaders when the player starts up.
Preloaded Assets
Set an array of assets to be loaded when the player starts up.
Vertex Compression
Vertex compression can be set per channel. You can, for instance, choose to have compression enabled for everything except positions and lightmap UVs. Whole mesh compression set per imported object will override the vertex compression on objects that have it set, while everything else will obey the vertex compression options/channels set here.
Optimize Mesh Data
Check this box to remove any data from meshes that is not required by the material applied to them (e.g. tangents, normals, colors, UV).
API Compatibility Level
You can choose your mono API compatibility level for all targets. Sometimes a 3rd-party .net dll will use things that are outside of the .net compatibility level that you would like to use. In order to understand what is going on in such cases, and how to best fix it, install “Reflector” for Windows.
Drag the .net assemblies for the API compatilibity level in question into Reflector. You can find these in Frameworks/Mono/lib/mono/YOURSUBSET/
Drag in your 3rd-party assembly.
Right-click your 3rd-party assembly and select “Analyze”.
In the analysis report, inspect the “Depends on” section. Anything that the 3rd-party assembly depends on, but that is not available in the .net compatibility level of your choice, will be highlighted in red there.
Customizing your Resolution Dialog
The Resolution Dialog, presented to end-users
You have the option of adding a custom banner image to the Screen Resolution Dialog in the Standalone Player. The maximum image size is 432 x 163 pixels. The image does not scale up to fit the screen selector, it is automatically centered and cropped.
Publishing to the Mac App Store
The property Use Player Log enables writing a log file with debugging information. This is useful for investigating problems with your game. However you need to disable this when publishing games for Apple’s Mac App Store, as Apple may reject your submission if it is enabled. See the Unity Manual
page for further information about log files.
The property Use Mac App Store Validation enables receipt validation for the Mac App Store. If this is enabled, your game will only run when it contains a valid receipt from the Mac App Store. Use this when submitting games to Apple for publishing on the App Store. This prevents people from running the game on a different computer to the one it was purchased on. Note that this feature does not implement any strong copy protection. In particular, any potential crack against one Unity game would work against any other Unity content. For this reason, it is recommended that you implement your own receipt validation code on top of this, using Unity’s plugin feature. However, since Apple requires plugin validation to initially happen before showing the screen setup dialog, you should still enable this check, or Apple might reject your submission.
Windows Store Apps
Player Settings
Most of these settings are transferred to Package.appxmanifest when creating Visual Studio solution for the first time.
Note: If you build your project on top of the existing one, Unity won’t overwrite Package.appxmanifest file if it’s already present, so check for this if you change something in Player Settings. If you want Package.appxmanifest to be regenerated, simply delete it and rebuild your project from Unity.
To read more about App package manifest, see the Windows Dev Center
Any settings you choose in Packaging, Application UI, Tile, Splash Screen and Capabilities directly transfer to settings in the Package.appxmanifest file.
Certificate
Every Windows Store App needs a certificate which identifies a developer. Unity creates a default certificate if you don’t provide your own.
Compilation
Unity uses Mono when compiling script files, and you can use the API located in .NET 3.5. Compilation Overrides allows you to use .NET for Windows Store Apps (also known as .NET Core) in your C# files. The API is available from the .
There are three options to choose from in Compiler Overrides:
C# files are compiled using Mono compiler.
Use .Net Core
C# files are compiled using Microsoft compiler and .NET Core. You can use Windows Runtime API, but classes implemented in C# files aren’t accessible from JS.
Use .Net Core Partially
C# files not located in Plugins, Standard Assets or Pro Standard Assets folders are compiled using Microsoft compiler and .NET Core. All other C# files are compiled using Mono compiler. The advantage here is that classes implemented in C# are accessible from JS.
Note: You won’t be able to test .NET Core API in Unity Editor, because it doesn’t have access to .NET Core. You’ll only be able to test the API when running the Windows Store App.
Note: You cannot use .NET Core API in JS.
Here’s a simple example of how to use .NET Core API in scripts.
string GetTemporaryFolder()
#if NETFX_CORE
return Windows.Storage.ApplicationData.Current.TemporaryFolder.P
return &LocalFolder&;
The property Unprocessed Plugins contains a list of plugins which are ignored by Unity’s preprocessing tools (like SerializationWeaver and AssemblyPreprocessor). Usually you don’t need to modify this list, unless you’re getting an error that Unity has failed to preprocess your plugin.
What happens if you add a plugin to this list?
Unity won’t inject additional IL code into your assembly used for serialization purposes. If your plugin isn’t referencing UnityEngine.dll, that’s fine, because Unity won’t serialize any data from your plugin.
Independent Input Source
The property Independent Input Source essentially gives you the ability to make your input more responsive. Learn more on the Windows Dev Center
class page.
Low Latency Presentation API
The property Low Latency Presentation API essentially creates a D3D11 swapchain with a DXGI\_SWAP\_CHAIN\_FLAG\_FRAME\_LATENCY\_WAITABLE_OBJECT flag, and can increase input responsiveness. Learn more on the Windows Dev Center
page. This option is disabled by default because on hardware with older GPU drivers, this option makes game laggy, if you enable this option - be sure to profile your game if the performance is still acceptable.
Capabilities
These options are directly copied to Package.appxmanifest.
Note: If you’re building your game on top of a previous package, Package.appxmanifest won’t be overwritten, so check for this if you change something in Player Settings.
Standalone
Multi-display

我要回帖

更多关于 fullscreenmode 的文章

 

随机推荐