Beyond Uber-Shaders EXPERIMENTATIONS ON IMPROVING SHADER & EFFECT WORKFLOW.

Slides:



Advertisements
Similar presentations
pa 1 Porting BETA to ROTOR ROTOR Projects Presentation Day, June by Peter Andersen.
Advertisements

© Copyright Khronos Group, Page 1 COLLADA FX Update and FX Composer 2.0 Daniel Horowitz & Ignacio Castaño.
Perspective aperture ygyg yryr n zgzg y s = y g (n/z g ) ysys y s = y r (n/z r ) zrzr.
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
COMPUTER GRAPHICS CS 482 – FALL 2014 NOVEMBER 10, 2014 GRAPHICS HARDWARE GRAPHICS PROCESSING UNITS PARALLELISM.
Review What is a virtual function? What can be achieved with virtual functions? How to define a pure virtual function? What is an abstract class? Can a.
ADVANCED SKIN SHADING WITH FACEWORKS Nathan Reed — NVIDIA March 24, 2014.
Advanced Rendering MATERIALS, POSTEFFECTS AND SCENE COMPOSITION GDC
OOP - Object Oriented Programming Object Oriented Programming is an approach to programming that was developed to make large programs easier to manage.
CSE 1302 Lecture 8 Inheritance Richard Gesick Figures from Deitel, “Visual C#”, Pearson.
Fast rendering of 2D applications with text and images Combines the power of DirectX and the convenience of.NET Adopted by most triple-A titles.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
WPSM Programming Language A simple language that transform simple data structure into complex xML format Wai Y. Wong Peter Chen Seema Gupta Miqdad Mohammed.
Scripting Languages For Virtual Worlds. Outline Necessary Features Classes, Prototypes, and Mixins Static vs. Dynamic Typing Concurrency Versioning Distribution.
Advanced Object-Oriented Programming Features
Tahir Nawaz Visual Programming C# Week 2. What is C#? C# (pronounced "C sharp") is an object- oriented language that is used to build applications for.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
Using Microsoft SharePoint to Develop Workflow and Business Process Automation Ted Perrotte National Practice Manager, Quilogy, Microsoft Office SharePoint.
GAM532 DPS932 – Week 1 Rendering Pipeline and Shaders.
REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006 Real-Time Volume.
1 Sandcastle Documentation Compilers For Managed Class Libraries common) Enabling managed class library developers throughout the world to easily create.
Lecture 8 Inheritance Richard Gesick. 2 OBJECTIVES How inheritance promotes software reusability. The concepts of base classes and derived classes. To.
Zhonghua Qu and Ovidiu Daescu December 24, 2009 University of Texas at Dallas.
Real-time Graphical Shader Programming with Cg (HLSL)
Geometric Objects and Transformations. Coordinate systems rial.html.
Parser-Driven Games Tool programming © Allan C. Milne Abertay University v
Shading. What is Shading? Assigning of a color to a pixel in the final image. So, everything in shading is about how to select and combine colors to get.
Chris Kerkhoff Matthew Sullivan 10/16/2009.  Shaders are simple programs that describe the traits of either a vertex or a pixel.  Shaders replace a.
A Crash Course in HLSL Matt Christian.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 24P. 1Winter Quarter C++ Lecture 24.
CS 480/680 Intro Dr. Frederick C Harris, Jr. Fall 2014.
Applied Computing Technology Laboratory QuickStart C# Learning to Program in C# Amy Roberge & John Linehan November 7, 2005.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
C++ History C++ was designed at AT&T Bell Labs by Bjarne Stroustrup in the early 80's Based on the ‘C’ programming language C++ language standardised in.
Shader Program in Gamebryo. Introduction Shader?  A complete Rendering Effect to apply to an object  Shader Program – Vertex/Pixel Shader Shader Programs.
The System Shall… Provide the ability to render 2D/3D graphics, these graphics will be represented by assets like models textures, and shaders. Manage.
AxKit A member of the Apache XML project Ryan Maslyn Kyle Bechtel.
Computer Graphics Blending CO2409 Computer Graphics Week 14.
CSE 381 – Advanced Game Programming GLSL. Rendering Revisited.
Dynamic Gaze-Contingent Rendering Complexity Scaling By Luke Paireepinart.
OpenGL-ES 3.0 And Beyond Boston Photo credit :Johnson Cameraface OpenGL Basics.
Computer Graphics 3 Lecture 6: Other Hardware-Based Extensions Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
August 2003 At A Glance The IRC is a platform independent, extensible, and adaptive framework that provides robust, interactive, and distributed control.
04 |Sharing Code Between Windows 8 and Windows Phone 8 in Visual Studio Ben Riga
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Java Programming, Second Edition Chapter Twelve Advanced Inheritance Concepts.
Inheritance and Class Hierarchies Chapter 3. Chapter Objectives  To understand inheritance and how it facilitates code reuse  To understand how Java.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS The GPU.
Advanced D3D10 Shader Authoring Presentation/Presenter Title Slide.
GLSL I.  Fixed vs. Programmable  HW fixed function pipeline ▪ Faster ▪ Limited  New programmable hardware ▪ Many effects become possible. ▪ Global.
Generic Programming and Library Design Brian Bartman
GPU Computing for GIS James Mower Department of Geography and Planning University at Albany.
Visual Programming Borland Delphi. Developing Applications Borland Delphi is an object-oriented, visual programming environment to develop 32-bit applications.
1© 2009 Autodesk Hardware Shade – Presenting Your Designs Hardware and Software Shading HW Shade Workflow Tessellation Quality Settings Lighting Settings.
How to use a Pixel Shader CMT3317. Pixel shaders There is NO requirement to use a pixel shader for the coursework though you can if you want to You should.
OOP - Object Oriented Programming
/* LIFE RUNS ON CODE*/ Konstantinos Pantos Microsoft MVP ASP.NET
Reflective Shadow Mapping By: Mitchell Allen.
Graphics Processing Unit
Deferred Lighting.
Chapter 6 GPU, Shaders, and Shading Languages
Understanding Theory and application of 3D
Lecture 22 Inheritance Richard Gesick.
UMBC Graphics for Games
UMBC Graphics for Games
Computer Graphics Introduction to Shaders
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
1.3.7 High- and low-level languages and their translators
Presentation transcript:

Beyond Uber-Shaders EXPERIMENTATIONS ON IMPROVING SHADER & EFFECT WORKFLOW

Shader in existing engines  Engine needs to generate many shaders  Lot of permutations  Comes from many places (material, scene, lighting, user, etc…)  Shaders tends to change over time (new rendering techniques)  Most common solution: uber-shaders + # define

Issues  Ubershaders  Monolithic design  Lot of #define  Difficult to read, maintain and extend  Some shader features spans across multiple files and shader stages  Hard to offer good entry points to users  Cross-platform (if need to target HLSL, GLSL & others)  Even more #define? Or write shader twice

Paradox Shader Language  Superset of HLSL  Everybody already familiar with HLSL  Can reuse existing HLSL shaders as is  Various language extensions  class, inheritance, composition, auto-generated shader input/output, etc..  1 rendering feature = 1 shader file (even if it impacts multiple functions and shader stages) Introducing Paradox SL (Shader Language)

Class & Inheritance  Simple inheritance ( class, abstract, virtual, override )  Multiple inheritance ( mixin ) class BaseInterface { abstract float Compute(); }; class BaseClass : BaseInterface { float Compute() { return 1.0f; } };

Composition  Compose with other classes as variables class BaseComposition : BaseInterface { BaseInterface composition1; BaseInterface composition2; float Compute() { return composition1.Compute() + composition2.Compute(); } };  Useful to build material shaders (BRDF, texture blend tree, etc…)

Streams  streams give access to shader inputs/outputs (syntax similar to this ) class BaseComposition : BaseInterface { stream float4 stream1 : MYSEMANTIC; float4 PSMain() { return streams.stream1; } };  VS/PS inputs/outputs automatically deduced from actual use (code analysis)  Ex: if use MYSEMANTIC in PS, VS pass-through code will be auto-generated POSITION Write once Pixel Shader 1 TEXCOORD0 MYSEMANTIC Vertex Shader Pixel Shader 2

Generics & others  generics allows you to write reusable code class BaseComposition : BaseInterface { float Compute() { return TValue; } };  var deduces variable type with type inference (similar to C++11 auto ) ex: var test = lerp(test1, test2);

Shaders  Goal: 1 rendering feature = 1 shader file (even if it affects multiple functions or shader stages)  Shader codebase very clean and organized  Mostly everything can be reused and combined  Examples:  Specular Models: (Fresnel: Schlick, Visibility: Shlick-GGX, Cook-Torrance, Implicit), etc…  Transform: ViewProj, Skinning, Tessellation (Flat, PN, AEN, Displacement)  ShadowMapping: VSM, PCF, Cascade, etc…  User can add his own shaders  Lot of override points

Effects  effect describes what shaders to combine (runtime) effect MyEffect { mixin TransformationWVP; // Default World View Proj transform mixin Tessellation; if (UseCustomEffect) // Parameters are fed by user or engine mixin MyCustomDeformation; // Custom deformation (user shader) mixin child ShadowCasting; // Fork sub-effect for shadowcast mixin MaterialShading; // Material shaders (generated from material) };

Pipeline  Paradox effects create a list of Shaders to “mix”  Paradox shaders are compiled to standard HLSL shader  Optionally, it can be auto-converted to GLSL Paradox Shaders HLSLGLSL Paradox Shader Compiler Paradox HLSL2GLSL Converter Paradox Effect

Visual Studio integration Syntax highlighting

Visual Studio integration Live errors & F12 (Go to reference)

Library  It’s a.NET assembly  Opensource   Includes full shader parser, AST, visitor & type analysis for  HLSL  GLSL  ParadoxSL  HLSL2GLSL transform visitor  Can’t wait to see what people build with it!  Other language extensions, analysis tools, etc…

Questions  Any questions?