Sébastien Dominé, NVIDIA. CgFX

Similar documents
Shader Programming CgFX, OpenGL 2.0. Michael Haller 2003

Shaders : the sky is the limit Sébastien Dominé NVIDIA Richard Stenson SCEA

DirectX Programming #4. Kang, Seongtae Computer Graphics, 2009 Spring

Advanced Rendering & Shading

Creating Real Shaders in FX Composer. Kevin Bjorke NVIDIA Corporation

Shaders (some slides taken from David M. course)

Introduction to Shaders.

Lab 3 Shadow Mapping. Giuseppe Maggiore

Accelerating Realism with the (NVIDIA Scene Graph)

Pipeline Integration with FX Composer. Chris Maughan NVIDIA Corporation

The Effects Framework. October 31, Composed of the following components:

Evolution of GPUs Chris Seitz

Teaching Cg. This presentation introduces Cg ( C for graphics ) and explains why it would be useful when teaching a computer graphics course.

The Application Stage. The Game Loop, Resource Management and Renderer Design

High-Precision Shading and Geometry. Kevin Bjorke NVIDIA Corporation

Getting Started with Cg. Release 1.2 February 2004

NVIDIA FX Composer. Developer Presentation June 2004

Shaders in Eve Online Páll Ragnar Pálsson

NVSG NVIDIA Scene Graph

PVRShaman. User Manual

NVIDIA Developer Tools for Graphics and PhysX

EDAF80 Introduction to Computer Graphics. Seminar 3. Shaders. Michael Doggett. Slides by Carl Johan Gribel,

Programming Graphics Hardware

MXwendler Fragment Shader Development Reference Version 1.0

Cg Toolkit. Cg 1.3 Release Notes. December 2004

Computer Graphics Coursework 1

Cg Toolkit. Cg 1.2 Release Notes

Whitepaper. Using SAS with CgFX and FX file formats. Kevin Bjorke

Canonical Shaders for Optimal Performance. Sébastien Dominé Manager of Developer Technology Tools

NVIDIA Tools for Artists

Basics of GPU-Based Programming

Computer Graphics with OpenGL ES (J. Han) Chapter XI Normal Mapping

Shaders. Slide credit to Prof. Zwicker

Quick Shader 0.1 Beta

Shaders Part II. Traditional Rendering Pipeline

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

Designing a Modern GPU Interface

Cg 2.0. Mark Kilgard

OPENGL RENDERING PIPELINE

Graphics Hardware. Graphics Processing Unit (GPU) is a Subsidiary hardware. With massively multi-threaded many-core. Dedicated to 2D and 3D graphics

Cg Toolkit. Cg 2.2 April 2009 Release Notes

OpenGL ES 2.0 : Start Developing Now. Dan Ginsburg Advanced Micro Devices, Inc.

Cg Toolkit. Cg 2.1 October 2008 Release Notes

Graphics Hardware. Instructor Stephen J. Guy

Copyright Khronos Group, Page Graphic Remedy. All Rights Reserved

Technical Report. Mesh Instancing

Cg Toolkit. Cg 2.1 beta August 2008 Release Notes

GLSL Introduction. Fu-Chung Huang. Thanks for materials from many other people

GPU Performance Tools

RenderMonkey 1.6. Natalya Tatarchuk ATI Research

GPU Programmable Graphics Pipeline

GLSL Introduction. Fu-Chung Huang. Thanks for materials from many other people

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

Dave Shreiner, ARM March 2009

Shader Series Primer: Fundamentals of the Programmable Pipeline in XNA Game Studio Express

Introduction to OpenGL

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Cg Toolkit. Cg 2.2 February 2010 Release Notes

Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping

Transforming Production Workflows with the GPU. Kevin Bjorke, NVIDIA SIGGRAPH 2004

CS 354R: Computer Game Technology

Cg Toolkit. Cg 2.0 May 2008 Release Notes

What s New in DI-Guy 12.5

Teaching a Modern Graphics Pipeline Using a Shader-based Software Renderer

SDK White Paper. Rainbows and Fogbows Adding Natural Phenomena

Programmable Graphics Hardware

Cg Toolkit. Cg 2.0 January 2008 Release Notes

COMP371 COMPUTER GRAPHICS

Pump Up Your Pipeline

PyFX: A framework for programming real-time effects

Whitepaper. Using SAS with CgFX and FX file formats. Kevin Bjorke

CS 4620 Program 3: Pipeline

OpenGL Performance Tools

Models and Architectures

The Rasterization Pipeline

Siggraph Agenda. Usability & Productivity. FX Composer 2.5. Usability & Productivity 9/12/2008 9:16 AM

Data passed from a source application is recognized by the destination application, yielding identical results. Data (Converted) compatibility

TentamensKod: (Ifylles av student) Tentamensdatum: Tid: 10:00 12:00. Hjälpmedel: Inga hjälpmedel

CREATING AND USING NORMAL MAPS - A Tutorial

Shading Shades. Frank Jargstorff. June 1, Abstract

The Ultimate Developers Toolkit. Jonathan Zarge Dan Ginsburg

CG Surfaces: Materials, Shading, and Texturing

Cg Toolkit. Cg 1.4 rc 1 Release Notes

CS GPU and GPGPU Programming Lecture 7: Shading and Compute APIs 1. Markus Hadwiger, KAUST

Programmable Graphics Hardware

This beta version is limited to export static model without animation. It also will omit every 10th polygon from the

Programming Graphics Hardware

Real-Time Rendering (Echtzeitgraphik) Dr. Michael Wimmer

Programming Graphics Hardware. GPU Applications. Randy Fernando, Cyril Zeller

Forward rendering. Unity 5's rendering paths. Which lights get what treatment?

Input Nodes. Surface Input. Surface Input Nodal Motion Nodal Displacement Instance Generator Light Flocking

Performance Tools. Raul Aguaviva, Sim Dietrich, and Sébastien Dominé

Computer Graphics with OpenGL ES (J. Han) Chapter 6 Fragment shader

Today. Texture mapping in OpenGL. Texture mapping. Basic shaders for texturing. Today. Computergrafik

CSE 167: Lecture #8: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Practical Performance Analysis Koji Ashida NVIDIA Developer Technology Group

CS GPU and GPGPU Programming Lecture 3: GPU Architecture 2. Markus Hadwiger, KAUST

developer.nvidia.com The Source for GPU Programming

Custom Component Development Using RenderMonkey SDK. Natalya Tatarchuk 3D Application Research Group ATI Research, Inc

Advanced Lighting Techniques Due: Monday November 2 at 10pm

Transcription:

Sébastien Dominé, NVIDIA CgFX

Overview What is CgFX? CgFX runtime Production pipeline with CgFX CgFX Tools set Demo

What is CgFX? Supports Microsoft.fx files Cg plus: Multi-pass Hardware fallbacks (techniques) Complete Hardware states Tweakables MS.fx plus: DirectX8 and OpenGL MAC and Linux

CgFX overview

.fx file float4x4 worldmatrix : World; // World or model matrix float4x4 mvpmatrix : WorldViewProjection; // Model * View * Projection float4x4 worldviewmatrix : WorldView; // World * View texture diffusetexture : DiffuseMap < string File = "default_color.dds"; >; // Diffuse Map semantic // Default texture file annotation texture normalmap : NormalMap // Normal Map semantic < string File = "default_bump_normal.dds"; // Default texture file annotation >; float4 ambientcolor : Ambient < > = {0.1, 0.1, 0.1, 1.0}; float bumpheight < // GUI annotations string gui = "slider"; float min = 0; float max = 1; float step = 0.1; > = 0.5;

.fx file void DiffuseBumpVS( float4 Position : POSITION, // Position in object space float2 TexCoord : TEXCOORD0, // Texture coordinates out float4 TexCoord0 : TEXCOORD0, // Texture coordinates out float4 Position : POSITION)// Position in projection space { TexCoord0.xy = IN.TexCoord.xy; // Pass texture coordinates for the diffuse map Position = mul(worldviewproj, IN.Position); // Compute position in projection space } void DiffuseBumpPS( float4 Position : POSITION, // Position in projection space out float4 col : COLOR) { float4 color = tex2d(diffusemap, UV); // Look up the diffuse map col = color * light; // Modulate the diffuse color by the light }

.fx file sampler2d diffusesampler = sampler_state { Texture = <diffusetexture>; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; }; sampler2d normalsampler = sampler_state { Texture = <normalmap>; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; }; technique CgTechnique { pass p0 { ZEnable = true; ZWriteEnable = true; CullMode = None; // Both the vertex and the fragment shaders are in Cg } VertexShader = compile vs_1_1 DiffuseBumpVS(mvpMatrix, WorldIMatrix, lightpos); PixelShader = compile ps_1_1 DiffuseBumpPS(diffuseSampler, normalsampler, bumpheight); } pass p1 {... }

CgFX Runtime Currently at Beta 3 Final release will be fully compatible with DX9 D3DXEffects Simple API enables creation of effects from.fx files Compiled into efficient state-blocks Can then enumerate techniques, parameters, semantics, etc. Typical render loop: peffect->begin(&numpasses,0); for (PassNum = 0; PassNum < numpasses; ++PassNum) { } peffect->end(); peffect->pass(passnum); pdevice->drawprimitive(nvprimitive_trianglelist, StartVertex, mesh.num_faces);

Production Pipeline with CgFX

CgFX Tools Set Integrated authoring in DCC apps: 3ds MAX 5.1 MAYA 4.5 XSI (CgFX Coming soon...) NVB Exporter CgFX Viewer OpenGL ARB, DirectX8, DirectX9

3ds max 5.1 stdmaterial <-> CgFX Height maps to normal maps Ability to select MAX scene lights and connect them to.fx parameters On the fly editing of shaders and auto-update of.fx GUI MAXSCRIPT support Source Code

Maya 4.5 Dynamic Shader specific GUI Supports.fx shader format Support native Maya attributes to render.fx tweakables Samples include: Bumpy Shiny, Toon, Anisotropic Metal, Ghostly, Refraction Dispersion, Rainbow Integrated with Maya s lights Intuitive artist controls Slider control over key real-time parameters (e.g., bump depth) CgFX integrated with Maya s hypershade node based shader editor Source Code

NVB Exporter for 3ds max Based on Pierre Terdiman s 3ds max exporter http://www.codercorner.com/flexporter.htm Exports Scene data Mesh, materials, lights, camera, skinning, etc... Exports CgFX materials ICgFXDataBridge interface Source code

CgFX Viewer Scene graph GUI.fx parameters edition Error reporting for easy.fx file problem identification Runs OpenGL, DirectX8, DirectX9 Switch between devices at any point

Demos

Questions? Sébastien Dominé sdomine@nvidia.com cgsupport@nvidia.com