ppt模板-配色简洁内容丰富.pptx

上传人:sh****n 文档编号:20766499 上传时间:2021-04-18 格式:PPTX 页数:33 大小:3.25MB
收藏 版权申诉 举报 下载
ppt模板-配色简洁内容丰富.pptx_第1页
第1页 / 共33页
ppt模板-配色简洁内容丰富.pptx_第2页
第2页 / 共33页
ppt模板-配色简洁内容丰富.pptx_第3页
第3页 / 共33页
资源描述:

《ppt模板-配色简洁内容丰富.pptx》由会员分享,可在线阅读,更多相关《ppt模板-配色简洁内容丰富.pptx(33页珍藏版)》请在装配图网上搜索。

1、Adam SchaefferMicrosoft CorporationSESSION CODE: WPH3 0 8 锐普PPT论坛chinakui首发 Consistent sets of hardware capabilities defined by MicrosoftResolutionTouch InputCPU / GPURAMHardware keyboard is optional Low level controlStraight to the metalRaw performance tuning High level abstractionRely on compiler

2、and runtimeDeveloper productivity Powerful and expressiveType safety reduces hard-to-track-down bugsReflectionInitializer syntaxGreat tooling (IntelliSense)Similar enough to C that learning and porting are easyBlazingly fast compilesC# Usually within a few percent of native performanceAwesome genera

3、tional garbage collectionPerformance shootout: Raymond Chen vs. Rico Marianihttp:/ 0 0 5 /0 5 /1 0 /4 1 6 1 5 1 .aspx Significant delta between managed and native.NET Compact FrameworkSimplistic mark-and-sweep garbage collectionXbox is not a general purpose computerUnforgiving in-order CPU architect

4、ureRequires custom VMX instructions for optimal math perfSecurity architecture poses challenges for jitted code In between Windows and Xbox 3 6 0.NET Compact FrameworkKeep an eye on garbage collection!ARMv7 CPUMore forgiving toward jitted codeARM jitter is more mature than PPC Instance methodInterfa

5、ceDelegate / eventReflectionVirtual method C+ allows independent choice of.NET types dictate their allocation and usage semanticsData typeThe memory in which a type lives (placement new)How a type instance is referenced (T, T*, Tc = Matrix.Multiply(a, b); / copies 192 bytes! Matrix.Multiply(ref a, r

6、ef b, out c); C+ .NETAllocate Initially fast, becoming slower as fragmentation increases Very fast, apart from periodic garbage collectionsFree Fast InstantaneousFragmentation Increases over time NoneCache coherency Requires custom allocators Things allocated close in time are also close in physical

7、 locationGarbage collection is not optionalCant have type safety without automatic memory management Triggered per megabyte of allocation1 Starts with root references (stack variables, statics)2 Recursively follows all references to see what other objects can be reached3 Anything we didnt reach must

8、 be garbage4 Compacts the heap, sliding live objects down to fill holes5 Frameworks designed for performance Frameworks designed for performanceMake it run Less OftenIf you never allocate, GC will never run Make it Finish QuicklyCollection time is proportional to how many object references must be t

9、raversedUse object pools Simple heap = fast collectionUse value types and integer handles Explicitly forces a garbage collectionUse wisely to give yourself more headroomAfter loadingDuring pauses in gameplayDont call every frame! Beware of boxingstring vs. StringBuilderUse WeakReference to track GC

10、frequencyhttp:/ 0 0 7 /1 0 /1 2 /monitoring-the-garbage-collector.aspxUse CLR Profiler on WindowsSee MIX1 0 talk: “Development and Debugging Tools for Windows Phone 7 Series”Use .NET Reflector to peek behind the curtainhttp:/www.red- Plus hardware accelerated 2D sprite drawingBasicEffectSkinnedEffec

11、tEnvironmentMapEffectAlphaTestEffectDualTextureEffect 0-3 directional lights Blinn-Phong shading Optional texture Optional fog Optional vertex colorBasicEffectVertex Cost Pixel CostNo lighting 5 1One vertex light 40 1Three vertex lights 60 1Three pixel lights 18 50+ Texture +1 +2+ Fog +4 +2 DualText

12、ureEffect For lightmaps, detail textures, decals Blends two textures Separate texture coordinates Modulate 2X combine mode (A*B*2) Good visuals at low pixel cost Vertex Cost Pixel CostTwo Textures 7 6+ Fog +4 +2 For billboards and imposters Adds alpha test operations (pixel kill) Standard blending i

13、s free with all effects Only need alpha test if you want to disable depth/stencil writesAlphaTestEffectVertex Cost Pixel Cost, =, 6 6=, != 6 10+ Fog +4 +2 SkinnedEffect For animated models and instancing Game code animates bones on CPU Vertex skinning performed by GPU Up to 72 bones One, two, or fou

14、r weights per vertex Vertex Cost Pixel CostOne vertex light 55 4Three vertex lights 75 4Three pixel lights 33 51+ Two bones +7 +0+ Four bones +13 +0+ Fog +0 +2 EnvironmentMapEffect Oooh, shiny! Diffuse texture + cube environment map Cheap way to fake many complex lights Fresnel term simulates behavi

15、or when light reaches a surface and some reflects, some penetrates Vertex Cost Pixel CostOne light 32 6Three lights 36 6+ Fresnel +7 +0+ Specular +0 +2+ Fog +0 +2 Framerate Numberof PixelsPixel Cost Framerate 3 0 hz refresh rate No point updating faster than the display! Game.TargetElapsedTime = Tim

16、eSpan.FromSeconds(1 f / 3 0 ); Pixel Cost Prefer cheaper effects Minimize overdrawMany known algorithms:Distance, frustum, BSP, sort front to backImplement “overdraw x-ray mode” Draw untextured with additive blendingBrighter areas indicate overdraw Numberof Pixels 8 0 0 x4 8 0 is 2 5 % more pixels t

17、han Xbox 1Great for textToo many pixels for intensive games8 0 0 x4 8 0 = 3 8 4 ,0 0 0 pixels6 0 0 x3 6 0 = 2 1 6 ,0 0 0 pixels (5 6 %) Dedicated hardware scaler Does not consume any GPU Higher quality than bilinear upsampling Avoid PreferRenderTargetUsage.PreserveContentsRenderTargetUsage.DiscardCo

18、ntentsdevice.BlendState = new BlendState .;/ At startupstatic BlendState myState = new BlendState .;/ Per frameDevice.BlendState = myState;VertexBuffer.SetData(.)device.DrawUserPrimitives(.);/ orDynamicVertexBuffer.SetData(., SetDataOptions.NoOverwrite); Great 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

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!