各种强大模板课件.pptx

上传人(卖家):三亚风情 文档编号:3344599 上传时间:2022-08-22 格式:PPTX 页数:33 大小:3.22MB
下载 相关 举报
各种强大模板课件.pptx_第1页
第1页 / 共33页
各种强大模板课件.pptx_第2页
第2页 / 共33页
各种强大模板课件.pptx_第3页
第3页 / 共33页
各种强大模板课件.pptx_第4页
第4页 / 共33页
各种强大模板课件.pptx_第5页
第5页 / 共33页
点击查看更多>>
资源描述

1、Adam SchaefferMicrosoft CorporationSESSION CODE:WPH308锐普PPT论坛chinakui首发rapidbbsConsistent sets of hardware capabilities defined by MicrosoftResolutionTouch InputCPU/GPURAMHardware keyboard is optional锐普PPT论坛chinakui首发:rapidbbs锐普PPT论坛chinakui首发:rapidbbsLow level controlStraight to the metalRaw perfor

2、mance tuningHigh level abstractionRely on compiler and runtimeDeveloper productivity锐普PPT论坛chinakui首发:rapidbbsPowerful and expressiveType safety reduces hard-to-track-down bugsReflectionInitializer syntaxGreat tooling(IntelliSense)Similar enough to C that learning and porting are easyBlazingly fast

3、compilesC#锐普PPT论坛chinakui首发:rapidbbsUsually within a few percent of native performanceAwesome generational garbage collectionPerformance shootout:Raymond Chen vs.Rico Marianis.msdn/ricom/archive/2019/05/10/416151.aspx锐普PPT论坛chinakui首发:rapidbbsSignificant delta between managed and native.NET Compact

4、FrameworkSimplistic mark-and-sweep garbage collectionXbox is not a general purpose computerUnforgiving in-order CPU architectureRequires custom VMX instructions for optimal math perfSecurity architecture poses challenges for jitted code锐普PPT论坛chinakui首发:rapidbbsIn between Windows and Xbox 360.NET Co

5、mpact FrameworkKeep an eye on garbage collection!ARMv7 CPUMore forgiving toward jitted codeARM jitter is more mature than PPC锐普PPT论坛chinakui首发:rapidbbsInstance methodInterfaceDelegate/eventReflectionVirtual method锐普PPT论坛chinakui首发:rapidbbsC+allows independent choice of.NET types dictate their alloca

6、tion and usage semanticsData typeThe memory in which a type lives(placement new)How a type instance is referenced(T,T*,T&,const T&)Value typesint,bool,struct,Vector3Reference typesclass,array,string,delegate,boxed value types锐普PPT论坛chinakui首发:rapidbbsOft-repeated wisdomValue types live on the stackR

7、eference types live on the heapValue types live wherever they are declaredReference types have two piecesMemory allocated from the heapA pointer to this heap memoryThat is subtly incorrect锐普PPT论坛chinakui首发:rapidbbsBy default,prefer class over structureUse struct for things that areSmall(=16 bytes)Sh

8、ort livedPass large structures by referenceMatrix a,b,c;c=Matrix.Multiply(a,b);/copies 192 bytes!Matrix.Multiply(ref a,ref b,out c);锐普PPT论坛chinakui首发:rapidbbsC+.NETAllocateInitially fast,becoming slower as fragmentation increasesVery fast,apart from periodic garbage collectionsFreeFastInstantaneousF

9、ragmentationIncreases over timeNoneCache coherencyRequires custom allocatorsThings allocated close in time are also close in physical locationGarbage collection is not optionalCant have type safety without automatic memory management锐普PPT论坛chinakui首发:rapidbbsTriggered per megabyte of allocation1Star

10、ts with root references(stack variables,statics)2Recursively follows all references to see what other objects can be reached3Anything we didnt reach must be garbage4Compacts the heap,sliding live objects down to fill holes5锐普PPT论坛chinakui首发:rapidbbsFrameworks designed for performanceFrameworks desig

11、ned for performanceMake it run Less OftenIf you never allocate,GC will never runMake it Finish QuicklyCollection time is proportional to how many object references must be traversedUse object poolsSimple heap=fast collectionUse value types and integer handles锐普PPT论坛chinakui首发:rapidbbsExplicitly forc

12、es a garbage collectionUse wisely to give yourself more headroomAfter loadingDuring pauses in gameplayDont call every frame!锐普PPT论坛chinakui首发:rapidbbsBeware of boxingstring vs.StringBuilderUse WeakReference to track GC frequencyhttp:/s.msdn/shawnhar/archive/2019/10/12/monitoring-the-garbage-collecto

13、r.aspxUse CLR Profiler on WindowsSee MIX10 talk:“Development and Debugging Tools for Windows Phone 7 Series”Use.NET Reflector to peek behind the curtainhttp:/red-gate/products/reflector/锐普PPT论坛chinakui首发:rapidbbs锐普PPT论坛chinakui首发:rapidbbsPlus hardware accelerated 2D sprite drawingBasicEffectSkinnedE

14、ffectEnvironmentMapEffectAlphaTestEffectDualTextureEffect锐普PPT论坛chinakui首发:rapidbbs0-3 directional lightsBlinn-Phong shadingOptional textureOptional fogOptional vertex colorBasicEffectVertex CostPixel CostNo lighting51One vertex light401Three vertex lights601Three pixel lights1850+Texture+1+2+Fog+4+

15、2锐普PPT论坛chinakui首发:rapidbbsDualTextureEffectFor lightmaps,detail textures,decalsBlends two texturesSeparate texture coordinatesModulate 2X combine mode(A*B*2)Good visuals at low pixel costVertex CostPixel CostTwo Textures76+Fog+4+2锐普PPT论坛chinakui首发:rapidbbsFor billboards and impostersAdds alpha test

16、 operations(pixel kill)Standard blending is free with all effectsOnly need alpha test if you want to disable depth/stencil writesAlphaTestEffectVertex CostPixel Cost,=,66=,!=610+Fog+4+2锐普PPT论坛chinakui首发:rapidbbsSkinnedEffectFor animated models and instancingGame code animates bones on CPUVertex skin

17、ning performed by GPUUp to 72 bonesOne,two,or four weights per vertexVertex CostPixel CostOne vertex light554Three vertex lights754Three pixel lights3351+Two bones+7+0+Four bones+13+0+Fog+0+2锐普PPT论坛chinakui首发:rapidbbsEnvironmentMapEffectOooh,shiny!Diffuse texture+cube environment mapCheap way to fak

18、e many complex lightsFresnel term simulates behavior when light reaches a surface and some reflects,some penetratesVertex CostPixel CostOne light326Three lights366+Fresnel+7+0+Specular+0+2+Fog+0+2锐普PPT论坛chinakui首发:rapidbbs锐普PPT论坛chinakui首发:rapidbbsFramerateNumberof PixelsPixel Cost锐普PPT论坛chinakui首发:

19、rapidbbsFramerate 30 hz refresh rate No point updating faster than the display!Game.TargetElapsedTime=TimeSpan.FromSeconds(1f/30);锐普PPT论坛chinakui首发:rapidbbsPixel Cost Prefer cheaper effects Minimize overdrawMany known algorithms:Distance,frustum,BSP,sort front to backImplement“overdraw x-ray mode”Dr

20、aw untextured with additive blendingBrighter areas indicate overdraw锐普PPT论坛chinakui首发:rapidbbsNumberof Pixels 800 x480 is 25%more pixels than Xbox 1Great for textToo many pixels for intensive games800 x480=384,000 pixels600 x360=216,000 pixels(56%)Dedicated hardware scaler Does not consume any GPU H

21、igher quality than bilinear upsampling锐普PPT论坛chinakui首发:rapidbbs锐普PPT论坛chinakui首发:rapidbbsAvoidPreferRenderTargetUsage.PreserveContentsRenderTargetUsage.DiscardContentsdevice.BlendState=new BlendState.;/At startupstatic BlendState myState=new BlendState.;/Per frameDevice.BlendState=myState;VertexBuf

22、fer.SetData(.)device.DrawUserPrimitives(.);/orDynamicVertexBuffer.SetData(.,SetDataOptions.NoOverwrite);锐普PPT论坛chinakui首发:rapidbbsGreat performance comes from great knowledgeUnderstandActionsValue types vs.reference typesGarbage collectionC#compiler magic(foreach,iterator methods,closures)Cost of the different graphical effect optionsUse CLR Profiler and.NET ReflectorRender smaller than display resolution,rely on scaler锐普PPT论坛chinakui首发:rapidbbs锐普PPT论坛chinakui首发:rapidbbs锐普PPT论坛chinakui首发:rapidbbs

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 办公、行业 > 各类PPT课件(模板)
版权提示 | 免责声明

1,本文(各种强大模板课件.pptx)为本站会员(三亚风情)主动上传,163文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。
2,用户下载本文档,所消耗的文币(积分)将全额增加到上传者的账号。
3, 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(发送邮件至3464097650@qq.com或直接QQ联系客服),我们立即给予删除!


侵权处理QQ:3464097650--上传资料QQ:3464097650

【声明】本站为“文档C2C交易模式”,即用户上传的文档直接卖给(下载)用户,本站只是网络空间服务平台,本站所有原创文档下载所得归上传人所有,如您发现上传作品侵犯了您的版权,请立刻联系我们并提供证据,我们将在3个工作日内予以改正。


163文库-Www.163Wenku.Com |网站地图|