Strategies and Techniques for Real-Time Shaders Neil Hazzard Software Engineer Autodesk, Media and Entertainment.

Slides:



Advertisements
Similar presentations
Introduction to Direct3D 10 Course Porting Game Engines to Direct3D 10: Crysis / CryEngine2 Carsten Wenzel.
Advertisements

Exploration of advanced lighting and shading techniques
POST-PROCESSING SET09115 Intro Graphics Programming.
© Copyright Khronos Group, Page 1 COLLADA FX Update and FX Composer 2.0 Daniel Horowitz & Ignacio Castaño.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
ONYX RIP Version Technical Training General. Overview General Messaging and What’s New in X10 High Level Print and Cut & Profiling Overviews In Depth.
Filtering Approaches for Real-Time Anti-Aliasing
Advanced Rendering MATERIALS, POSTEFFECTS AND SCENE COMPOSITION GDC
Real-time Dynamic HDR Based Lighting in a Static Environment Marcus Hennix Daniel Johansson Gunnar Johansson Martin Wassborn.
Introduction to Shader Programming
Advanced lighting and rendering Multipass rendering.
AGD: 5. Game Arch.1 Objective o to discuss some of the main game architecture elements, rendering, and the game loop Animation and Games Development.
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.
CSS552 Final Project Demo Peter Lam Tim Chuang. Problem Statement Our goal is to experiment with different post rendering effects (Cel Shading, Bloom.
Aaron Schultz. Idea: Objects close to a light shadow those far away. Anything we can see from the light’s POV is lit. Everything hidden is dark. Distance.
Written by Liron Blecher
CP The 30,000-Foot View of Autodesk® 3ds Max® Customization and Plug-in Development Kevin Vandecar Principal Developer Consulting Engineer – M&E.
Introduction to Nikola Mihaylov, Sep 1, 2008.
GPU Programming Robert Hero Quick Overview (The Old Way) Graphics cards process Triangles Graphics cards process Triangles Quads.
Zhonghua Qu and Ovidiu Daescu December 24, 2009 University of Texas at Dallas.
Real-time Graphical Shader Programming with Cg (HLSL)
Games Development Practices 3D Model Import/Export CO2301 Games Development 1 Week 17.
Computer Graphics Texture Mapping
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.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
Computer Graphics Using Direct 3D Introduction. 2 What are we doing here? Simply, learning how to make the computer draw.
به نام خدا تنظیم کننده : فرانه حدادی استاد : مهندس زمانیان تابستان 92.
Fast Cascade VSM By Zhang Jian.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Textures Repeated patterns Texture can be uniform or irregular Ex:fabric,soil,brick Surface finish also known as surface texture T = P 1 * V 1 * V c T=
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
NVIDIA CONFIDENTIAL Hardware Shading for Artists.
Shader Study 이동현. Vision engine   Games Helldorado The Show Warlord.
FitNesse.NET tips and tricks Gojko Adzic
NVIDIA FX Composer 2 Shader Authoring for Everyone Philippe Rollin Aravind Kalaiah.
CSE 381 – Advanced Game Programming GLSL. Rendering Revisited.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
2009 GRAPHICS : PROJECT 1 BASED ON DX9 BASICS. Documented by Dongjoon Kim SNU CS Ph.D Course Student Contact : NOTE.
Computer Graphics 3 Lecture 6: Other Hardware-Based Extensions Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
Plug-in Architectures Presented by Truc Nguyen. What’s a plug-in? “a type of program that tightly integrates with a larger application to add a special.
 Learn how you can use the shader through OpenGL ES  Add texture on object and make the object have a different look!!
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.
Resources & Bitmaps Adding clip art to your application.
CgFX Sébastien Dominé, NVIDIA. Overview What is CgFX? CgFX runtime Production pipeline with CgFX CgFX Tools set Demo.
Rendering an Animation James Martin High School Computer Multimedia and Animation Instructor: G. Patton From: CHAPTER 15 – 3DS MAX AND ITS APPLICATIONS.
Computer Graphics Imaging Lecture 13 and 14 UV Mapping.
Computer Science – Game DesignUC Santa Cruz Tile Engine.
Build your own 2D Game Engine and Create Great Web Games using HTML5, JavaScript, and WebGL. Sung, Pavleas, Arnez, and Pace, Chapter 5 Examples 1.
How to write a Pixel Shader CMT3311. Aim The aim of these slides is to introduce you to enough HLSL that you get a general understanding of pixel shaders.
Build your own 2D Game Engine and Create Great Web Games using HTML5, JavaScript, and WebGL. Sung, Pavleas, Arnez, and Pace, Chapter 5 Examples 3.
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.
Shaders, part 2 alexandri zavodny.
Ying Zhu Georgia State University
Advance Steel: Automatic generation
Reflective Shadow Mapping By: Mitchell Allen.
Photorealistic Rendering vs. Interactive 3D Graphics
Ogre Overview.
End-of-Term Winter Progress Report
UMBC Graphics for Games
UMBC Graphics for Games
Computer Animation UV Mapping.
UMBC Graphics for Games
Desktop Window Manager
Computer Graphics Introduction to Shaders
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
03 | Creating, Texturing and Moving Objects
Games Development 2 Tools Programming
Presentation transcript:

Strategies and Techniques for Real-Time Shaders Neil Hazzard Software Engineer Autodesk, Media and Entertainment

Overview  Recap from GDC 2005  What’s new in 3ds max 8  Scene Effects  Extending effects with MAXscript  Tips  Lots of Demos…

Quick Recap from GDC 2005  3ds max supports HLSL Effect files  Dynamic UI creation based on Semantic and Annotations in the file  Automatic update of changed file and bitmaps  Based on Parser Technology  Two Formats supported. 3ds max and DxSAS 0.8  MAXScript extendible  GDC 2005 session available 

What’s new in 3ds max 8  New Annotation “ColorChannel” specifies whether a Map Channel contains color information.  int texcoord1 : Texcoord  <  int Texcoord = 1;  int MapChannel = 10;  bool ColorChannel = true;  >;  #define support - _3DSMAX_, 3DSMAX, MAX & _MAX_ Easier support for max specific code, by using #ifdef _MAX_  Use of DiffuseMap semantic to provide better Material Editor sample slot rendering  Scene Effects

Scene Effects  Effects that work at the scene level  Pre Effects – runs before any geometry is drawn  Useful for background images  Post Effects – runs after all geometry is drawn  Any “post production” work – blur, glow etc..  Environment Effects – special type that process the scene for use in per object rendering  Ideal for Shadow Maps or CubeMaps generation  Only work with the DirectX 9 Shader Material

Using Scene Effects - 1/4  Scene effects use a ParamID of 0x003  Tells the system to use the correct parser  Uses bool PreShader = true; to help the parser with usage.  Post effects receive the render target containing the scene in a texture parameter called SceneMap.  Pre Effects simply render into the current active render target.  Load the scene effects using the Scene Effect Loader Utility

Using Scene Effects - 2/4  Example of the post_output.fx file #include "quad.fxh“//helper file for drawing quads string ParamID = "0x003";//tells the system what parser //Macro to define the Scene texture and sampler DECLARE_QUAD_TEX(SceneMap,SceneSampler,"X8R8G8B8") //Simple pixel shader that simply outputs the input scene data float4 OutputPS(VertexOutput IN) : COLOR { float4 texCol = float4(tex2D(SceneSampler, IN.UV).xyz,1); // Do anything else here return texCol; }

Using Scene Effects - 3/4  Environment Effects  Run before the main scene output starts  Should run in conjunction with object based shaders  Object shaders can then use specific transforms setup by the environment stage  An Example is light transforms for Shadow maps  Use multiple techniques, one for environment pass and another for final pass. Have a naming convention so the parser can set them dynamically  Can create maps that would be used by objects based effects

Using Scene Effects – 4/4  Developers can write their own scene parsers  Node sorting and filtering can be implemented  The utility simply sorts based on the GBuffer ID and filters non DirectX 9 Shader materials  New interfaces – see RTMax.h  IDxSceneManager, IValidateNodeCallback and IDxSceneTransformManager

Extending with MAXScript Scripted Material Auto Generated UI

Extending with MAXScript  Scripted Material  plugin material StandardFX name:"StandardFX" classID:#(692421,413582) extends:DirectX_9_Shader replaceUI:true version:1 (…)  Parameters use the name defined in the effect file  You could still use “showproperties meditmaterials[1]” to list the names  Simply use the delegate keyword to set the value  The texture used by effects is actually a bitmap type

Extending with MAXScript  On Create Handler (Scripted_StandardFX.ms) on create do ( -- setup initial material effectfile = GetDir #maxroot effectfile = effectfile + "\\maps\\fx\\StandardFX.fx" delegate.effectfile = effectfile ambientlock = true )

Extending with MAXScript  Button Handler (Scripted_StandardFX.ms) on b_topDiffuseClr pressed do ( b = selectbitmap caption: "Top Diffuse Map" if b != undefined then ( delegate.g_TopTexture = b b_topDiffuseClr.text = b.filename topdiffuseMap = b --defined as type:#bitmap )

Extending with MAXScript  Generates custom and sophisticated UIs  Allows data validation and Access control  E.g. power of two textures, or textures no greater than a certain size.  Can provide workarounds for the UI widgets generated by the parsers  Scriptable values instead of UI generated can drive delegate values  E.g. UV clamping etc..

Things to remember  Annotations are case sensitive  The three built in parsers are very different, don’t mix up your annotations  Type verses ResourceType  name verses ResourceName  3ds max is Z-up  You soon find this out with cubemaps!!  Swap YZ around to make it work  Currently only camera based matrixes are support at the object level.  Use Scripted materials  Good to work around “Auto UI” look and feel  Data management/validation

Resources   Sample parsers available and documentation    msdn.microsoft.com/directx  Ben Cloward  