UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS 2D Rendering.

Slides:



Advertisements
Similar presentations
Graphics Pipeline.
Advertisements

Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
INTRODUCTION. Painting with numbers! Aspects Modeling Rendering Animation.
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
CGDD 4003 THE MASSIVE FIELD OF COMPUTER GRAPHICS.
Pixel Shader Vertex Shader The Real-time Graphics Pipeline Input Assembler Rasterizer Output Merger.
Status – Week 283 Victor Moya. 3D Graphics Pipeline Akeley & Hanrahan course. Akeley & Hanrahan course. Fixed vs Programmable. Fixed vs Programmable.
The Graphics Pipeline CS2150 Anthony Jones. Introduction What is this lecture about? – The graphics pipeline as a whole – With examples from the video.
Exam.1 Si23_03 SI23 Introduction to Computer Graphics Revision Lecture.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Under the Hood: 3D Pipeline. Motherboard & Chipset PCI Express x16.
CHAPTER 4 Window Creation and Control © 2008 Cengage Learning EMEA.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Visual quality techniques.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
3D API By Clayton Azzopardi (Group 10). Introduction Android uses the OpenGL ES 1.0 API Android uses the OpenGL ES 1.0 API Open Graphics Library for Embedded.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Textures.
Large-Scale Polygon Rendering. Solutions Decimation Visibility Culling Parallel Rendering Others.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
Advanced Computer Graphics Depth & Stencil Buffers / Rendering to Textures CO2409 Computer Graphics Week 19.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS The Geometry Pipeline.
CS 638, Fall 2001 Multi-Pass Rendering The pipeline takes one triangle at a time, so only local information, and pre-computed maps, are available Multi-Pass.
Introduction to XNA Graphics Programming Asst. Prof. Rujchai Ung-arunyawee COE, KKU.
3D Graphics for Game Programming Chapter IV Fragment Processing and Output Merging.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Shadow Mapping Chun-Fa Chang National Taiwan Normal University.
GRAPHICS PIPELINE & SHADERS SET09115 Intro to Graphics Programming.
CS662 Computer Graphics Game Technologies Jim X. Chen, Ph.D. Computer Science Department George Mason University.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
CS418 Computer Graphics John C. Hart
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
CSE 381 – Advanced Game Programming GLSL. Rendering Revisited.
OpenGL-ES 3.0 And Beyond Boston Photo credit :Johnson Cameraface OpenGL Basics.
Mobile Graphics Patrick Cozzi University of Pennsylvania CIS Spring 2012.
File Texture Mapping Pasting images on primitives.
컴퓨터 그래픽스 Real-time Rendering 1. Introduction.
Fateme Hajikarami Spring  What is GPGPU ? ◦ General-Purpose computing on a Graphics Processing Unit ◦ Using graphic hardware for non-graphic computations.
Ray Tracing using Programmable Graphics Hardware
Edison Gao 主讲人:高原. GameFinal A Next-Gen 3D Game Engine Edison Gao.
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.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Lighting.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS The GPU.
The Graphics Pipeline Revisited Real Time Rendering Instructor: David Luebke.
Graphics, Modeling, and Textures Computer Game Design and Development.
GAM666 – Introduction To Game Programming ● Textures are simply 2D images which are spread over the triangles of a 3D shape ● Each vertex has texture coordinates.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
GLSL Review Monday, Nov OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Geometry for Game. Geometry Geometry –Position / vertex normals / vertex colors / texture coordinates Topology Topology –Primitive »Lines / triangles.
Graphing a System of Inequalities
3 – Graphs of Inequalities (No Calculator)
Programmable Pipelines
The Graphics Rendering Pipeline
File Texture Mapping Pasting images on primitives.
Graphics, Modeling, and Textures
Drawing Issues Drawing Coordinate Systems Drawing with Pixels CS-321
Graphics Processing Unit
Introduction to Computer Graphics with WebGL
The Graphics Pipeline Lecture 5 Mon, Sep 3, 2007.
Texture and Shadow Mapping
Unity’s Standard Shader Physically Based Shading
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
03 | Creating, Texturing and Moving Objects
Computer Graphics (under.) Sep., 2017
OpenGL-Rendering Pipeline
Opengl implementation
Presentation transcript:

UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS 2D Rendering

Goals 1. Learn the basic states used in 2D rendering 2. See how to render 2D images on the screen 3. Review the fixed function pixel pipeline

D3D Calls SetRenderStateSets a variety of states global to D3D (there are many) SetPixelShaderSelects how to express per-pixel calculations SetFVFSets the format of the vertices SetTextureSets a texture image (there can be more than one) SetSamplerStateSelects how the texture will be sampled from SetTextureStageStateSelects how the texture values will be used ClearFills a region of the screen to a single value DrawPrimitiveUPInitiates the actual drawing

Typical global configuration  Disable Z-buffering and stencil  SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);  SetRenderState(D3DRS_ZWRITEENABLE, FALSE);  SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);  Disable pixel shader (will use the texture stage states)  SetPixelShader(NULL);  Normal shading and no culling  SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);

Typical global configuration (cont.)  Enable alpha-blending  SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, FALSE);  SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);  SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);  SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);  SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_ADD);  Disable alpha-testing  SetRenderState(D3DRS_ALPHATESTENABLE, FALSE);

Basic primitive: the rectangle  Create the vertices  Vertex const vertices[4] = {  { 20, 20, 0, 1, … },  { 100, 20, 0, 1, … },  { 20, 100, 0, 1, … },  { 100, 100, 0, 1, … }, };  Set up the vertex format (must match the data!)  SetFVF(D3DFVF_XYZRHW | …);  And render  DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, vertices, sizeof(vertices[0]));

Textures  Select the texture image:  SetTexture(0, pTexture);  Select the sampling settings:  SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);  SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);  SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);  SetSamplerState(0, D3DSAMP_ADDRESSU, D3DADDRESS_CLAMP);  SetSamplerState(0, D3DSAMP_ADDRESSV, D3DADDRESS_CLAMP);

Texture calculations  Perform custom calculations for every pixel. For instance:  SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);  SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);  SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_CURRENT);  SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);  SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_CURRENT);  SetTextureStageState(0, D3DTSS_TEXCOORDINDEX, 0);  Disable the first one that’s not needed  SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE);  SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);