CgFX Sébastien Dominé, NVIDIA. Overview What is CgFX? CgFX runtime Production pipeline with CgFX CgFX Tools set Demo.

Slides:



Advertisements
Similar presentations
© Copyright Khronos Group, Page 1 COLLADA FX Update and FX Composer 2.0 Daniel Horowitz & Ignacio Castaño.
Advertisements

Perspective aperture ygyg yryr n zgzg y s = y g (n/z g ) ysys y s = y r (n/z r ) zrzr.
Bump Mapping CSE 781 Roger Crawfis.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
GAM532 DPS932 – Week 7 Introduction to shadows. Shadow Effects Light Surface No Shadows Shadows.
Advanced Rendering MATERIALS, POSTEFFECTS AND SCENE COMPOSITION GDC
Strategies and Techniques for Real-Time Shaders Neil Hazzard Software Engineer Autodesk, Media and Entertainment.
The Programmable Graphics Hardware Pipeline Doug James Asst. Professor CS & Robotics.
Real-time Dynamic HDR Based Lighting in a Static Environment Marcus Hennix Daniel Johansson Gunnar Johansson Martin Wassborn.
Introduction to Shader Programming
Shading Languages Yung-feng Chiu. 2 Agenda Introduction Pixar’s RenderMan, MS’s HLSL, NV’s CgFX, ATI’s RenderMonkey Demos.fx file Comparsion.
Atila OGL library “T&L emulated via Vertex Shaders”
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Introduction to Computer Graphics Ed Angel Professor of Computer Science, Electrical and.
Vertex & Pixel Shaders CPS124 – Computer Graphics Ferdinand Schober.
Cg Overview Cg is the High Level language from NVIDIA for programming GPUs, developed in close collaboration with Microsoft Cg is 100% compatible with.
Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Shaders Feb 18, 2011 Creative Commons Attribution 3.0 (Except copyrighted.
Cross-Platform Development using FX Composer 2.0 Chris Maughan · Kevin Bjorke Alpha 4 · GDC 2006.
Cg Kevin Bjorke GDC NVIDIA CONFIDENTIAL A Whole New World with Cg Graphics Program Written in Cg “C” for Graphics Compiled & Optimized Low Level,
1 High Level Shader Language (HLSL) Chapter What is HLSL? The previous vertex and pixel shader programming is to use assembly language to write.
Week 3 - Wednesday.  What did we talk about last time?  Project 1  Graphics processing unit  Programmable shading.
Integrating Shaders into Your Game Engine Bryan Dudash NVIDIA Developer Technology.
Cg – C for Graphics Eric Vidal CS 280. History General graphics processing languages – Renderman shading language (1988) Assembly languages for graphics.
REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006 Real-Time Volume.
Week 3 - Friday.  What did we talk about last time?  Vertex shaders  Geometry shaders  Pixel shaders.
CS 480/680 Computer Graphics Course Overview Dr. Frederick C Harris, Jr. Fall 2012.
GPU Programming Robert Hero Quick Overview (The Old Way) Graphics cards process Triangles Graphics cards process Triangles Quads.
CHAPTER 4 Window Creation and Control © 2008 Cengage Learning EMEA.
Programming Concepts. Derive a new class from Activity of the framework Prepare the data beforehand, e.g., vertices, colours, normal vectors, texture.
Real-time Graphical Shader Programming with Cg (HLSL)
Geometric Objects and Transformations. Coordinate systems rial.html.
OpenGL Shading Language (Advanced Computer Graphics) Ernest Tatum.
GPU Shading and Rendering Shading Technology 8:30 Introduction (:30–Olano) 9:00 Direct3D 10 (:45–Blythe) Languages, Systems and Demos 10:30 RapidMind.
Overview [See Video file] Architecture Overview.
A Crash Course in HLSL Matt Christian.
Computer graphics & visualization The programmable (D3D 10) Pipeline.
1 Introduction to Computer Graphics SEN Introduction to OpenGL Graphics Applications.
Computer Graphics I, Fall 2008 Introduction to Computer Graphics.
CSE 690: GPGPU Lecture 6: Cg Tutorial Klaus Mueller Computer Science, Stony Brook University.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Shadow Mapping Chun-Fa Chang National Taiwan Normal University.
NVIDIA CONFIDENTIAL Hardware Shading for Artists.
Module Code: CU1025NI 3D Modelling and Animation Basics Week - 2.
The Cg Runtime Cyril Zeller. Cg Pipeline Graphics programs are written in Cg and compiled to low-level assembly code... Cg Runtime API...
Shader Program in Gamebryo. Introduction Shader?  A complete Rendering Effect to apply to an object  Shader Program – Vertex/Pixel Shader Shader Programs.
Maya 8 at a Glance Chapter 4: Creating Textures. Shaders 2 Lambert: No highlights Phong: Distinct specular highlights Phong E: Greater controls for softer.
NVIDIA FX Composer 2 Shader Authoring for Everyone Philippe Rollin Aravind Kalaiah.
2009 GRAPHICS : PROJECT 1 BASED ON DX9 BASICS. Documented by Dongjoon Kim SNU CS Ph.D Course Student Contact : NOTE.
 Learn some important functions and process in OpenGL ES  Draw some triangles on the screen  Do some transformation on each triangle in each frame.
09/25/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Shadows Stage 2 outline.
Ray Tracing using Programmable Graphics Hardware
Adam Pletcher Volition, Inc. / THQ Shader Pipeline – Volition, Inc.
Gamebryo Shaders.
3D Objects in WebGL Loading 3D model files. Announcement Midterm exam on 12/2 –No Internet connection. –Example code and exam questions will be on USB.
Module 05 –Bump mapping Module 05 – Bump mapping Module 05 Advanced mapping techniques: Bump mapping.
An Introduction to the Cg Shading Language Marco Leon Brandeis University Computer Science Department.
Computer Science – Game DesignUC Santa Cruz Tile Engine.
Advanced Materials Using Shaders. Show demo advanced_ogre.
Game Engines Game: – Engine – Assets (models, animations, sounds, AI, and physics) – Code (Rules, AI, Scripting, etc.)
Ying Zhu Georgia State University
Reflective Shadow Mapping By: Mitchell Allen.
9.2. Other notable AI Aspects / HLSL Intro
Introduction to Computer Graphics
Computer Graphics Module Overview
Chapter XIV Normal Mapping
Computer Graphics Practical Lesson 10
Computer Graphics Introduction to Shaders
Computer Graphics with Three.JS
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
03 | Creating, Texturing and Moving Objects
Games Development 2 Tools Programming
Presentation transcript:

CgFX Sébastien Dominé, NVIDIA

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 // Diffuse Map semantic < string File = "default_color.dds"; // 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 = ; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; }; sampler2D normalSampler = sampler_state { Texture = ; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; }; technique CgTechnique// Both the vertex and the fragment shaders are in Cg { pass p0 { ZEnable = true; ZWriteEnable = true; CullMode = None; 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->Pass(PassNum); pDevice->DrawPrimitive(NVPRIMITIVE_TRIANGLELIST, StartVertex, mesh.num_faces); } pEffect->End();

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

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 Maya 4.5

NVB Exporter for 3ds max Based on Pierre Terdiman’s 3ds max exporter 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é