34
CEDEC 2006 State of the Art Cross Platform Shader Development Philippe Rollin

State of the Art Cross Platform Shader Development - Nvidiadeveloper.download.nvidia.com/presentations/2006/cedec/2006-cedec... · CEDEC 2006 State of the Art Cross Platform Shader

Embed Size (px)

Citation preview

CEDEC 2006

State of the Art Cross Platform Shader

Development

Philippe Rollin

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Agenda

FX Composer 2.0 OverviewCross-Platform Shader AuthoringProduction Pipeline IntegrationConclusionQ&A

Copyright © NVIDIA Corporation 2004 CEDEC 2006

FX Composer 2.0What and Who?

What is it for?Shader Authoring IDEDebugging and ProfilingScene IntegrationAsset Management

Who is it for?Graphics ProgrammersTechnical DirectorsTechnical ArtistsArtists

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Your Requirements

Handling of complex renderingHighly customizable layout managementPowerful user interfaceShader performance profilingPlug-in based architectureScriptable

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Flexible Render

Many API & shading language combinationsSurface and fullscreenshaders

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Improved User Interface

Customized user layoutsShow or hide panelsVC2005 docking styleSave/Load layouts

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Improved User Interface

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Typical FX Composer LayoutProperties

PreviewInfo, Scripting, ErrorsTextures

CodingManagement

Copyright © NVIDIA Corporation 2004 CEDEC 2006

DEMO:Shader Authoring

Loading ProjectCompilingErrors and Tasks

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Project Explorer

Manage multiple documents

Documents contain one or more assets

Assets are effects, materials, meshes, and other scene elements

Organize you assetsMove, copy, delete, renameDrag and dropOne or many documentsEffect Libraries

COLLADA

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Open asset exchange format (.dae)

Governed by the Khronos GroupIncludes numerous ISVs and IHVsMature DCC plugins for extensive support

Supported by FX Composer 2Import & ExportSupports effects and materialsFacilitates asset exchange with DCC appsOther file formats supported

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Library View

Organize across documentsSort assets by typeVisualize Assets

ScenesEffect

Authoring

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Effect Authoring

View effect structureTechniquesPassesParameters

Authoring using toolbars and context menus

Add childrenRemove childrenAdvanced options

Copyright © NVIDIA Corporation 2004 CEDEC 2006

CgFX & COLLADA FX Cg

CgFXHand codedLess user interface assistance

COLLADA FX for Cg authoringMost user friendly experienceFully editable via user interfaceCan migrate your CgFX assetsLess hand coding

Zero XMLCg, GLSL only when writing the GPU shader code

Copyright © NVIDIA Corporation 2004 CEDEC 2006

DEMO:Material Authoring

Creating materialsAssigning effectsTweaking material parameters

Copyright © NVIDIA Corporation 2004 CEDEC 2006

DEMO:Scene Integration

Light creationScene traversalBind light to materialRealtime manipulation

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Shader Performance Simulation

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Production Pipeline Integration

Scene binding expressionsAutomation via scriptingPlug-in based architectureSource control integrationProduction Pipeline Samples

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Scene binding expressions

float4 LightPos : Position<

string Object = "PointLight";string Space = "Object";

> = {-10.0f, 10.0f, -10.0f, 0.0f};

Semantic

Annotations

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Custom Semantics and Annotations

1 :<RemappedSemantic name="myWorldView">2 : <MatrixMultiply description="World * View">3 : <input type="internalsemantic" value="world"/>4 : <input type="internalsemantic" value="view"/>5 : </MatrixMultiply>6 :</RemappedSemantic>

Hook parameter to scene and system dataExpressions via xml configuration fileExtensive Library of Operators

dot & cross products, mux, demux, matrix ops, ...Custom operators

Built from XML using operatorsVia plug-in

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Automation Via Scripting

Automatic assignment of Materials to geometryShader parameters to scene objects (nearest lights, cameras, etc...)A model’s accessories to attachment points

Common-tasks toolbar (ala Maya/MEL)

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Automation Via Scripting

#Python scripting

# Convert any Possible Profile to COLLADA FXdef ConvertToCOLLADA():

effects = FXRuntime.Instance.Library.FindLibraryItems(FXEffect)for effect in effects:

for profile in effect.Profiles:if profile.CanConvertToColladaFX() == True:

profile.ConvertToColladaFX()

# Create an effectdef bindMMM():

CmdGroupBegin.Do("script: assign cgfx files to MMM ")

SelectRenderPort("OpenGL")ForceRedraw()

CmdGroupEnd.Do()

# get the cgfx files to assign to MMM

files = FXEffectUtils.GetEffectFiles()for pathname in files:

...

Copyright © NVIDIA Corporation 2004 CEDEC 2006

DEMO:Scripting

Automatic assignmentEtc.

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Custom Plug-ins

Importers ExportersSemantic expression operatorsRendering devicesProcedural geometry generation (fins, hair, etc...)Custom authoring environment

…etc…

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Custom Plug-ins: Sky is the limit

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Source Control Integration

Seamless integration into source control softwareDocuments and assets reflect file-based state

Copyright © NVIDIA Corporation 2004 CEDEC 2006

ConsolePCMAC

Pipelines: FXC2 centric

FX Composer 2.0

COLLADA Scene with FX

COLLADADCC

Geometry

Conditioners and Compilers

GameBinary

Effects

GameBinary

GameBinary

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Pipelines: DCC centric

FXComposer

2.0

DCCApplication

Conditioner

SceneEffectLibrary

Console

GameBinary

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Pipelines: Handheld

FX Composer 2.0 ESRemoteRender

Data Conditionerand Compiler

Host PC Target Handheld

DCC ToolsXSI, Max Maya

GameEngine

COLLADA

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Pipelines: Engine

FX Composer 2.0

Game Importer

CgFX

GameBinary

D3D FX

COLLADA FX

Rendering Game Adapter Game Engine

GameBinary

Copyright © NVIDIA Corporation 2004 CEDEC 2006

FX Composer 2.0 Alpha 5

Alpha5 release ETA end of summer ’06Document and asset managementCOLLADA FX authoringShader parameter scene bindingCustom semantic and annotation supportPython scriptingShader performanceAvailable to Sony PS3 developers and limited partners

Beta release ETA end of fall ’06Open to public

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Conclusion

Next-generation of shader IDE is on its wayProduction-ready with powerful featuresNVIDIA is closely working with Khronos and others to deliver a professional-grade authoring tool

Copyright © NVIDIA Corporation 2004 CEDEC 2006

Q&A

Send us emails for early alpha and beta releases

[email protected]

ThanksPhilippe Rollin ([email protected])

Copyright © NVIDIA Corporation 2004 CEDEC 2006