FX Composer - Http. .nvidia

Transcription

FX ComposerA Programmer’s IntroKevin BjorkeNVIDIADeveloper Resources Group

OverviewWhat FX Composer IsWhat Makes FX Composer UniqueHow It Can Apply to Your Applications 2004 NVIDIA Corporation. All rights reserved.

Developing Shaders: ProgrammersShading tools are important for both Programmers andDesignersTo be complete for modern game engines, tools haveto support ideas like:Render-To-Texture (RTT)Multiple Render Targets (MRT)Render States like stencil, alpha blend, etc.Custom Texture Maps (e.g. Normalization cubes, noise)SHIrradiance and PRTManagement details to make sure complex ordering matches any specificgame engine’s render loopHow to get results in and out of your game engine orapplication, at every stage of production? 2004 NVIDIA Corporation. All rights reserved.

Developing Shaders: ArtistsArtists want to see what they design when they designit, not just guess at what it might look like laterNot just seeing the correct models, but also the correctlighting environment, so that the shaders viewedand/or developed can really be the ones used in-game.Implementations are typically different in each differentDCC application (Maya versus Max versus XSIversus .)We want to accommodate console-game designers,too: “What might my model look like on Playstation?” 2004 NVIDIA Corporation. All rights reserved.

01HLSL FX MetaformatA Tool Built for the TaskEasily swappable for artists andprogrammersAlready a part of DirectX andXNA – no external SDK requiredSome viewing support already inXSI, 3DStudio Max, and MayaAlready used in shipping, highperformance games 2004 NVIDIA Corporation. All rights reserved.

NVIDIA FX ComposerFX Composer empowers developers to create highperformance shaders in an integrated developmentenvironment with real-time preview & optimization featuresavailable only from NVIDIA.CREATE your shaders in a highpowered developer environmentDEBUG your shaders with basicshader debugging featuresTUNE your shader performancewith advanced analysis andoptimization featuresEverQuest content courtesy Sony Online Entertainment Inc. 2004 NVIDIA Corporation. All rights reserved.

01The Gold Standard inFX editing tools, withmore complete supportthan any otherCombine & customizeshadersExtensibleUse any 3D modelPerformance tuningWorks with RTZen et alhttp://www.fxcomposer.com/ 2004 NVIDIA Corporation. All rights reserved.Everquest Content CourtesySony Online Entertainment Inc.FX Composer

FX Composer - Screenshot 2004 NVIDIA Corporation. All rights reserved.

User Interface Screenshot 2004 NVIDIA Corporation. All rights reserved.

Materials & TexturesPreview all the FX files in your sceneat the same timeApply them to the appropriate parts ofyour scene in the Scene panelView source texturesPreview render targetsSave any texture to disk! 2004 NVIDIA Corporation. All rights reserved.

Editing and DebuggingEdit multiple .FX filesIntellisense (autocomplete)Syntax highlightingJump-to-error helps youfind & fix problemsquickly 2004 NVIDIA Corporation. All rights reserved.

Previewing & CustomizingConveniently edit yourshader parametersAutomatic parsing ofsemantics & annotationsQuickly select custom color valuesUpdate vector andmatrix values usingtear-off dialogsNavigate to select scene elementsand edit properties in the SceneGraph Panel 2004 NVIDIA Corporation. All rights reserved.

Tune Your Shader PerformanceUser the Shader Perf panelSelect the technique, pass andvertex or pixel shader to analyzeSimulate pixel shader performanceon any recent NVIDIA GPUOptimized DirectX AssemblyNVIDIA performance analysisGPU cycle countEfficiency / utilization ratingNumber of passesRegister usage 2004 NVIDIA Corporation. All rights reserved.

NVIDIA FX ComposerScene PanelPreview your 3D scene in real-timeApply materials to scene elementsManipulate the scene elements or the entire sceneUse primitives or import .x/.obj/etc models and .nvb scenesSet your own key frames or play existing animationsPlace lights and customize lighting propertiesSelect user-defined cameras or default scene camera 2004 NVIDIA Corporation. All rights reserved.

202D Shader Demo: Bloom and GloomShows:FP16 processingLayering of post-processeffects 2004 NVIDIA Corporation. All rights reserved.

Bloom and Gloom: Shading StackWe can assign by handin Material Editor, or editin the ScriptExecuteSorter Window 2004 NVIDIA Corporation. All rights reserved.

Render PipelinesIdentification and Feeding

Render Pipeline: The “A-B-C” ModelMany programs still use the simplest possible Zculled double-buffered pipeline:Clear to BG ColorRender Object ARender Object BRender Object CRender Object D Display complete scene!Examples include many older games and mostall DCC and CAD applications. 2004 NVIDIA Corporation. All rights reserved.

Programmable Shading in A-B-CThe method used by 3DStudio Max DirectX9Materials and in the CgFX plugins for Maya etcClear to BG ColorRender Object A (potentially in multiple passes)Render Object B (potentially in multiple passes)Render Object C (potentially in multiple passes)Render Object D Display complete scene!A great improvement in appearance, but still norender-to-texture effects etc. – so shaders mayor may not be the “real” final shaders 2004 NVIDIA Corporation. All rights reserved.

Going Beyond A-B-CMore complex rendering, like that in the MayaHardware Render Device, or modern gameengines, uses a rich mixture of 3D and 2DoperationsTextures created on the flySpecial masks for compositingStencilGlints and glowsEtc 2004 NVIDIA Corporation. All rights reserved.

A Simple Complex Pipeline .(this is a simplified example):Deep clear (floating point image)Render object D & B into one shadow mapDeep clear (floating point image)Render object C into another shadow mapClear to bg textureRender MRTs – object A and depth using previous shadow passesRender objects D&B using shadow passesSave to textureBlur verticallyBlur again, horizontallyRestore unaltered BG imageAdd part of blurred image to create bloom in brightest areasRender object C using blurred bg texture as refractionAdd textured fog based on MRT depth samplesDisplay complete scene 2004 NVIDIA Corporation. All rights reserved.

Complex PipelinesGame pipelines are becoming as complex asfilm-production pipelines, which may havedozens or hundreds of composited elements,each broken into multiple passes for shadowing,glows, diffuse/specular separation andbalancing, live-action BG plates, etc. 2004 NVIDIA Corporation. All rights reserved.

Complex Pipelines for GamesWhile film pipelines use multiple rendering andcompositing tools, interactive applications haveto do rendering and compositing operations inthe same app – and fastGame appearances may require differenthandling depending on the hardware – highend, low end, or console (potentially multiples) 2004 NVIDIA Corporation. All rights reserved.

Managing ComplexityProgrammability lets us bundle ideas togetherand control them flexiblyProgrammability up and down the entire chain:GPU shading unitsGraphics API stateTracking of basics like mouse, object transforms, etcHigh-level scene building, control, data import andexport 2004 NVIDIA Corporation. All rights reserved.

Layers of HLSL ProgrammabilityHLSL Pixel and Vertex shadersHLSL VM functions for the CPUHLSL VM Texture functions (“texture shaders”)HLSL DXSAS scripting for render-loop controlHLSL DXSAS scripting for layeringHLSL technique validation for varying GPUsIn FX Composer:Windows Common Language Runtime (CLR)C#VB.NETFX Composer SDK 2004 NVIDIA Corporation. All rights reserved.

Only in DirectX FX:HLSL Pixel and Vertex shadersHLSL VM functions for the CPUHLSL VM Texture functions (“texture shaders”)HLSL DXSAS scripting for render-loop controlHLSL DXSAS scripting for layeringHLSL technique validation for varying GPUsIn FX Composer:Windows Common Language Runtime (CLR)C#VB.NETFX Composer SDK 2004 NVIDIA Corporation. All rights reserved.

Only in FX Composer so far:HLSL Pixel and Vertex shadersHLSL VM functions for the CPUHLSL VM Texture functions (“texture shaders”)HLSL DXSAS scripting for render-loop controlHLSL DXSAS scripting for layeringHLSL technique validation for varying GPUsIn FX Composer:Windows Common Language Runtime (CLR)C#VB.NETFX Composer SDK 2004 NVIDIA Corporation. All rights reserved.

DXSAS Renderloop ScriptingScripts are stored in string annotationsScripts can be part of passes, techniques, andthe global FX scopeTechnique scripts can call pass scriptsGlobal scripts can call technique or pass scriptsDXSAS Script is our window to:Render to Texture (RTT)Multiple Render Targets (MRT)Conditional RenderingLayer of FX effects 2004 NVIDIA Corporation. All rights reserved.

“DXSAS” Sample ImplementationC# app w/complete sourcecodeUses ManagedDirect XSupport for DXSASincluding scriptingLess overhead fordisplay, so drawsfaster than FXComposer 2004 NVIDIA Corporation. All rights reserved.

FX Composer CLR ScriptingFX Composer is built as a .NET applicationMost controls are .COM assembliesScriptable from within FX Composer – no additionalprogram neededEdit with Intellisense etcC# and VB.NET supported via Common Language Runtime(CLR)Other CLR languages, such as Managed C or Jscript, couldbe made available if someone really needed themFast!“Nv sys” library can be browsed in the OLE ViewerMost operations can be done using this APICan talk to external DCC apps, SQL DBs, etc 2004 NVIDIA Corporation. All rights reserved.

Script Demo: Shader DonutsShows:C# Integration andhighlightingOLE Browser for“nv sys”Reading files from C#Creating NodesCreating KeyframesReading Annotations 2004 NVIDIA Corporation. All rights reserved.

FXComposer Plugin SDKPlugins are written externally in an environmentlike Visual StudioCompiled and then installed in the PlugindirectoryFX Composer’s SDK is mainly designed forobject import and material export (the CLR APIis also good at export) 2004 NVIDIA Corporation. All rights reserved.

C# AnimationC# Scripts are subclass of “INVUtility”The entry point is alwayspublic int Run(interop.nv sys.NVSystem Sys)Use OLE browser to explore nv sys namespaceWe can access almost every part of the FXComposer data structure, create objects, saveimages as well as communicate with other processes,files, etc.Samples supplied for both C# andVisualBasic.NET 2004 NVIDIA Corporation. All rights reserved.

SDK Demo: Import/ExportNot a Demo per se –Plugins are created inVisual Studio etcSome functionalityoverlaps C#Can be used for Importof custom geometryformats, material export(mtl exporter shown)Pix courtesy Mike Chowat Rainbow Studios 2004 NVIDIA Corporation. All rights reserved.

Frequently Asked QuestionsSupport Cg or GLSL?Integration with my engine?Integration with DCC applications?Compared to Effect Edit, Ginza, & others?Support for other platforms?The latest version of FX Composer and the full FAQ athttp://developer.nvidia.com/fxcomposer 2004 NVIDIA Corporation. All rights reserved.

For More Info.Download presentations, SDK, Tools, etc:http://developer.nvidia.comQuestions, requests, and comments for Toolsand SDK: sdkfeedback@nvidia.comAbout this presentation: kashida@nvidia.com 2004 NVIDIA Corporation. All rights reserved.

The Source forGPU Programmingdeveloper.nvidia.comLatest NewsDeveloper Events CalendarTechnical DocumentationConference PresentationsGPU Programming GuidePowerful Tools, SDKs, and more.Join our FREE registered developer programfor early access to NVIDIA drivers, cuttingedge tools, online support forums, and more!

developer.nvidia.comThe Source for GPU ProgrammingLatest documentationSDKsCutting-edge toolsPerformance analysis toolsContent creation toolsHundreds of effectsVideo presentations and tutorialsLibraries and utilitiesNews and newsletter archives 2004 NVIDIA Corporation. All rights reserved.EverQuest content courtesy Sony Online Entertainment Inc.

NVIDIA SDKThe source for real-time developersHundreds of code samples and effects thathelp you take advantage of the latest in graphicstechnology.Tons of updated and all-new DirectX and OpenGL codesamples with full source code and helpful whitepapers:Geometry Instancing, Rainbow Fogbow, Blood Shader,Perspective Shadow Maps, Texture Atlas Utility, .Hundreds of effects, complete withcustom geometry, animation and more:Skin, Plastics, Flame/Fire, Glow, Gooch,Image Filters, HLSL Debugging Techniques,Texture BRDFs, Texture Displacements,Tonemapping, and even a simple Ray Tracer! 2004 NVIDIA Corporation. All rights reserved.

GPU Gems: Programming Techniques,Tips, and Tricks for Real-Time GraphicsPractical real-time graphics techniques fromexperts at leading corporations and universitiesGreat value:Contributions from industry expertsFull color (300 diagrams and screenshots)Hard cover816 pagesFor more, visit:http://developer.nvidia.com/GPUGems“GPU Gems is a cool toolbox of advanced graphicstechniques. Novice programmers and graphics gurusalike will find the gems practical, intriguing, anduseful.”“This collection of articles isparticularly impressive for its depth andbreadth. The book includes productoriented case studies, previouslyunpublished state-of-the-art research,comprehensive tutorials, and extensivecode samples and demos throughout.”Tim SweeneyEric HainesLeadprogrammerUnreal 2004 NVIDIACorporation. Allofrightsreserved. at Epic GamesAuthor of Real-Time Rendering

The Cg ToolkitNVIDIA Cg CompilerVertex (DirectX 9, OpenGL 1.4)Pixel (DirectX 9)Cg Standard LibraryCg Runtime Libraries forDirectX and OpenGLNVIDIA Cg BrowserCg Language SpecificationCg User’s ManualCg Shaders(assorted pre-written programs)The Cg Tutorial(developer.nvidia.com/CgTutorial) 2004 NVIDIA Corporation. All rights reserved.

FX Composer CLR Scripting FX Composer is built as a .NET application Most controls are .COM assemblies Scriptable from within FX Composer - no additional program needed Edit with Intellisense etc C# and VB.NET supported via Common Language Runtime (CLR) Other CLR languages, such as Managed C or Jscript, could