3D Rendering – A beginners guide Phil Carlisle – University of Bolton.

Slides:



Advertisements
Similar presentations
COMPUTER GRAPHICS SOFTWARE.
Advertisements

An Optimized Soft Shadow Volume Algorithm with Real-Time Performance Ulf Assarsson 1, Michael Dougherty 2, Michael Mounier 2, and Tomas Akenine-Möller.
CSC418 Computer Graphics n Polygon normals n Back Faces n Visibility Algorithms.
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
Graphics Pipeline.
3D Graphics Rendering and Terrain Modeling
Hidden Surface Removal Why make the effort?  Realistic models.  Wasted time drawing. OpenGL and HSR  OpenGL does handle HSR using the depth buffer.
Visibility Culling. Back face culling View-frustrum culling Detail culling Occlusion culling.
Introduction to 3D Graphics Lecture 5: From Realism to Real-Time Anthony Steed University College London.
CS 4363/6353 INTRODUCTION TO COMPUTER GRAPHICS. WHAT YOU’LL SEE Interactive 3D computer graphics Real-time 2D, but mostly 3D OpenGL C/C++ (if you don’t.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
CGDD 4003 THE MASSIVE FIELD OF COMPUTER GRAPHICS.
Tomas Mőller © 2000 Speeding up your game The scene graph Culling techniques Level-of-detail rendering (LODs) Collision detection Resources and pointers.
Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering Cass Everitt and Mark J. Kilgard Speaker: Alvin Date: 5/28/2003 NVIDIA.
Status – Week 231 Victor Moya. Summary Primitive Assembly Primitive Assembly Clipping triangle rejection. Clipping triangle rejection. Rasterization.
Overview Introduction Constructing a scene Rendering Frustum culling OpenGL Performer.
Game Engine Design ITCS 4010/5010 Spring 2006 Kalpathi Subramanian Department of Computer Science UNC Charlotte.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Beyond Meshes Spring 2012.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Hidden Surface Removal
Erdem Alpay Ala Nawaiseh. Why Shadows? Real world has shadows More control of the game’s feel  dramatic effects  spooky effects Without shadows the.
Polygon Scan Conversion and Z-Buffering
Basics of Rendering Pipeline Based Rendering –Objects in the scene are rendered in a sequence of steps that form the Rendering Pipeline. Ray-Tracing –A.
COMP 175: Computer Graphics March 24, 2015
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CSE 381 – Advanced Game Programming Basic 3D Graphics
The Visibility Problem In many environments, most of the primitives (triangles) are not visible most of the time –Architectural walkthroughs, Urban environments.
Week 2 - Wednesday CS361.
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
Real-Time Rendering SPEEDING UP RENDERING Lecture 04 Marina Gavrilova.
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
2 COEN Computer Graphics I Evening’s Goals n Discuss application bottleneck determination n Discuss various optimizations for making programs execute.
Games Development 1 Camera Projection / Picking CO3301 Week 8.
David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
Image Synthesis Rabie A. Ramadan, PhD 4. 2 Review Questions Q1: What are the two principal tasks required to create an image of a three-dimensional scene?
CSCE 552 Spring D Models By Jijun Tang. Triangles Fundamental primitive of pipelines  Everything else constructed from them  (except lines and.
Basic Perspective Projection Watt Section 5.2, some typos Define a focal distance, d, and shift the origin to be at that distance (note d is negative)
David Luebke1/10/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
Maths & Technologies for Games Graphics Optimisation - Batching CO3303 Week 5.
Honours Graphics 2008 Session 5. Today’s focus Rasterization Visibility determination Coarse / fine visibility determination.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
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.
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
Computer Graphics Inf4/MSc 1 Computer Graphics Lecture 5 Hidden Surface Removal and Rasterization Taku Komura.
Graphics, Modeling, and Textures Computer Game Design and Development.
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
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.
Introduction to Computer Graphics
Visible Surface Detection
- Introduction - Graphics Pipeline
Scene Manager Creates and places movable objects like lights and cameras so as to access them efficiently, e.g. for rendering. Loads and assembles world.
Advanced D3D Programming Sim Dietrich
Graphics Processing Unit
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Jim X. Chen George Mason University
CSCE 441: Computer Graphics Hidden Surface Removal
Chapter V Vertex Processing
Lecture 13 Clipping & Scan Conversion
Joshua Barczak CMSC 435 UMBC
© University of Wisconsin, CS559 Fall 2004
Frame Buffer Applications
Presentation transcript:

3D Rendering – A beginners guide Phil Carlisle – University of Bolton

3D Rendering stages Gross culling Polygon definition Projection into 2D Clipping Rasterisation

Gross culling Definition – “To kill off as many polygons as early as possible” So imagine our view through the monitor, essentially it forms a pyramid with the top cut off (the narrow top part being the monitor, the wide base part being the far clip plane) We ideally only want to render those polygons which touch the volume this pyramid forms The pyramid is known as a “view frustum”

Gross culling So our task initially, is to reduce the number of polygons we end up rendering by doing something with the set of polygons which are held within this volume The more quickly and crudely we can do this, the better as detailed checks add more wasted time So we start by looking at the world and consider if there is something we can do to eliminate parts of it

Gross culling Various spatial techniques – Grid-lattice – Quadtrees – Octrees – BSP Trees with PVS – Bounding volume heirarchy (BVH) – Sphere tree’s – Large occluders Object based tests using hardware Bounding sphere/box tests against frustum

Polygon definition By now, we’ve reduced the polygon count We should have as much as possible, eliminated all objects which DO NOT intersect the view frustum We can expect some false positives We now need to actually render those objects But we need to be efficient

State management An issue with hardware rendering Various state changes slow down rendering Sort by shader! Sort by texture Render target changes can be expensive Shadows use render targets Deferred rendering seems to be popular

State management So we have an “Object”, we then split it into sub- mesh’s Each sub mesh, is basically defined by the material it uses to render with (i.e. the shader its using and the textures that shader uses) We group ALL mesh’s from ALL objects which share the same shader We then do the same within that sorting for the textures We then set the state ONCE and render ALL sub mesh’s from each bucket of sorted types

Scene graphs Many renderers use scene graphs as a method of constructing scenes OGRE is a scene graph API Scene graphs are useful for structuring a 3D scene because of their hierarchy They worked well when using the model of API’s like open GL which used a matrix stack NOT exactly the fastest Tom Forsyth says no! (link)

Projection into 2D Here we are going to send the 3D data to be processed into 2D data to then draw to the screen BUT! We want to be as efficient as possible Think of a typical 3D model, it is composed of triangles What can we do here to save ourselves some work? Triangle strips/fans

Projection into 2D So for each vertex from our mesh, we need to project it from 3D world space, into 2D screen space We apply the matrices: World * camera * projection The projection matrix basically incorporates a “Perspective divide” to create the perspective view, it also deals with aspect ratio and FOV We end up with a 2D screen space coordinate and a depth

Clipping So we have our triangles now as 2D triangles in screen space Only some of them might end up cutting the edge of the screen We need to be able to clip them! We can use a guard band arrangement ala PS2 Or we can use some algorithm – Sutherland Hodgeman – Cohen Sutherland

Rasterisation So by this stage, we have essentially a clipped set of triangles that we know are within the screen view We need to convert these “points” into filled triangles What data did was pass into the rasterizer? X,Y,Z coords, UV coords, Normals,Colours Its at this point we need to consider our shading model

Rasterization Active edge table Interpolate values from the input points across the edges Interpolate from the edges across each scanline Interesting note: In order for this to work, we need the perspective to work across the scanline and edges, that used to be VERY expensive doing the divides, so we fudged it Used a “divide every N pixels” approach Fixed point maths to avoid floating point calculations

Where do shaders come in? Vertex shaders – Basically do the projection from world/screen space – Can alter the points values for colour/uv etc Pixel shaders – Once the points are projected and the AET computed, the hardware goes to render the scanline and each pixel of that scanline has its pixel shader called

The footoor! Hardware is becoming much more programmable – Intel Larrabee – I assume Nvidia and ATI will quickly respond Which means that many of the older “Software” techniques are back in fashion Not using polygons at all!! Volumes? (Outland?Out…something) Sphere/Ellipsoid

Resources Nvidia developer site about DX10 level render optimisation BSP and PVS (Mike Abrash’s “Black Book”) Mike Abrash’s “Zen of Code Optimisation” Interesting about Mike and Intel/Larrabee/Pixomatic