Download presentation
Presentation is loading. Please wait.
Published bySarah Hensley Modified over 9 years ago
2
You can use 3D graphics to enhance and differentiate your Metro style app.
5
Map mashups Visualization Data-mining Medical Scientific Games
7
A lap around Direct3D -object model New features of Direct3D11 Supporting the whole range of PCs Resources available for Direct3D developers Takeaways You will understand how to get started writing a 3D Metro style app
8
DirectX11.1 is the version of DirectX11 that ships in Windows 8 It has some minor new features added, but most of the improvements are behind the scenes in terms of integration with the other core OS components
9
HTML, XAML
10
Direct3D object model
11
Vertex Decl Vertex Shader Pixel Shader OutputMerger State Direct3D object model Graphics Memory Resource s Graphics Memory Resource s Graphics State Graphics State Interface Mesh Object Texture Object Texture Object RenderTarget Objects Direct3D Device
12
The Direct3D device object Primary Direct3D API object Represents the core rendering engine Properties of the device == state of graphics chip All rendering resources are bound to the context Context abstraction enables multi-threading Direct3D Device Context
13
Meshes are stored in vertex buffers Indexed with index buffers Vertex buffers enable mesh data to be cached in graphics memory Vertex declaration defines a the data formats for the hardware Vertex Decl Vertex Format
14
Texture object Base Image Shader Resource View MIP Chain Pixel Format Texture Data
15
RenderTarget object Swap Chain = BackBuffer + FrontBuffer Swap Chain = BackBuffer + FrontBuffer Render Target View Pixel Format Pixel Data
17
Depth stencil object Depth/Stencil View Depth Buffer Pixel Format Pixel Data
18
float4 SimplePixelShader( sPSInput input ) : SV_TARGET { float3 toLight = normalize( float3(1,1,0) ); float intensity = saturate( dot( input.norm, toLight ) ); return SimpleTexture.Sample( SimpleSampler, input.tex )*intensity; } Vertex Decl Vertex Shader Pixel Shader OutputMerger State Direct3D Device Context
19
HLSL is compiled off-line with fxc.exe This enables 90% of the work to happen up front Driver translates (JITs) to it’s own instruction set at load time On call to d3dDevice->CreatePixelShader () Enables operation across hardware vendors and generations
20
Hardware is organized into a sequence of feature levels From Feature_Level_9_1 to Feature_Level_11_1 Many algorithms can use the same code across levels Others may need separate codepaths for optimal performance See Talk Tuning GPU Usage for Any Form Factor
21
New Features of Direct3D11.1
22
Advanced features Tessellation DirectCompute Double precision HQ texture compression Power-oriented features Low-precision HLSL instructions Optimizations for tiling GPUs
23
Available on DX11 feature level hardware Enhances mesh quality and detail Render using base mesh on slower PCs Use subdivided mesh on faster ones
24
Delivers general-purpose GPU processing to Metro style apps Teraflops of performance Foundation of C++ AMP (Accelerated Massive Parallelism) Runs on same device object as Direct3D So sharing resources for rendering is instantaneous
25
Technical computing needs fast double precision math New instructions were added for key transcendentals Full performance on newer GPUs Emulated on older ones HLSL now supports an image search instruction msad4: Vector Sum of Absolute Differences Accelerated in future hardware, emulated on Windows 8 drivers
26
Direct3D supports texture compression BC1 4-bits/pixel for RGB formats6x compression ratio BC2,3 8-bits/pixel for RGBA formats4x compression ratio This is strongly recommended Smaller package means faster downloads of your app Feature Level 11 hardware added 2 new formats BC6 for high dynamic range imagery BC7 for higher quality content
27
8k x 4k image @ 24 bits/pixel = 32MPix WorldMap.bmp 98MB 1x WorldMap.dds (BC1) + mip maps 22MB 5x WorldMap.zip (e.g. in.appx package) 7MB14x WorldMap.jpg 5.5MB17x
28
.Worldmap.jpg Worldmap.dds BC1 compressed
29
Optimizing for power and battery life is important All shaders in DirectX currently default to 32-bit precision As of Windows 8, you can use 16-bit float or int data Enables some hardware to work at twice the rate for the same power
30
Some power-optimized GPUs use an output image cache called a tile These chips can get a performance boost with a special flag m_swapChain->Present(1, 0); // present the image on the display ComPtr view; m_renderTargetView.As(&view) // get the view on the RT m_d3dContext->DiscardView(view.Get()); // release the view
31
Developer resources
33
Goal: optimize 3D assets as part of build phase Runtime app package contains only optimized data Keep the package download as small as possible Don’t keep users waiting for your app!
34
Shader.cso Asset compilation Shader.hlsl Author-time Asset Build Step Run-time Asset myApp. appx Packager Package Texture.bmp Mesh.obj Music.wav Texture.dds Mesh.vbo Music.wma
35
The samples are designed to Make it easy to see the API calls used and how they work Show incremental steps toward building a real app Samples tip: set a breakpoint in DirectXSample.h #line 18 to see HRESULTS before the exception
36
Tutorials Introduce very basic initial concepts from step 1 In-line code to favor readability over factoring of functionality Simple samples Provide starting points for developers adding specific techniques Each sample builds on the last demonstrating another technique SimpleD3D, Simple3DTouch, ResourceLoading, D3DPostProcessing, Stereo… E2E sample ‘starter kits’ with source Demonstrate integration of all components (basic*.cpp) Simple3DGame, ModernMarbleMaze
37
Direct3D Tutorial Basic elements of 3D graphics taught step-by-step using Direct3D Visual Studio 11 Visualization and Debugging DirectX-oriented features like texture viewing, shader analysis, mesh validation, API call debugging Visual Studio Debugging More chances to try out the debugging and 3D basics
38
[PLAT-766T] Introduction to DirectX for Metro style apps [PLAT-750T] Build your first Metro style game [PLAT-752T] Tuning GPU usage for any form factor [TOOL-761T] A lap around DirectX game development tools [PLAT-756T] Building Xbox LIVE games for Windows 8
39
Windows 8 is the ideal platform for 3D apps.
40
3D is a valuable way to differentiate your Metro style app Direct3D11 is the solution for 3D in Windows 8 Direct3D is fully supported with APIs, tools, and samples Go build your 3D Metro style app!
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.