Sky Boxes and Vector Math 2 Course Information CVG: Programming 4 My Name: Mark Walsh Website: www.activehelix.co.uk/courseswww.activehelix.co.uk/courses.

Slides:



Advertisements
Similar presentations
Exploration of advanced lighting and shading techniques
Advertisements

This terms course Last term we both worked on learning 2 things –Processing –The concepts of graphics etc. This term will focus more on the basic concepts.
Graphics Pipeline.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
Projection Matrix Tricks Eric Lengyel Outline  Projection Matrix Internals  Infinite Projection Matrix  Depth Modification  Oblique Near Clipping.
Week 9 - Wednesday.  What did we talk about last time?  Fresnel reflection  Snell's Law  Microgeometry effects  Implementing BRDFs  Image based.
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.
Background Caches for Large Outdoor Scenes Bill Hess.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
SET09115 Intro Graphics Programming
WAWERU HANNAH NYAKIO B02/53847/2012. PERSPECTIVE DRAWING  Perspective drawing is a drawing technique used to illustrate dimension through a flat surface.
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
Shadow Algorithms Ikrima Elhassan.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
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.
Computer Visualization BIM Curriculum 03. Topics  History  Computer Visualization Methods  Visualization Workflow  Technology Background.
CSE 381 – Advanced Game Programming Basic 3D Graphics
Sky Rendering The actual physics is very complicated and costly to calculate. Several cheap approaches for very distant skies: –Constant backdrop –Skybox.
Introduction to Textures and Skins Chapter 8 & 9 3D Game Programming All-in-One By Ken Finney.
Week 2 - Wednesday CS361.
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
Buffers Textures and more Rendering Paul Taylor & Barry La Trobe University 2009.
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
1 CO Games Concepts Week 20 Matrices continued Gareth Bellaby.
Advanced Computer Graphics Depth & Stencil Buffers / Rendering to Textures CO2409 Computer Graphics Week 19.
Copyright © 2015 Curt Hill Models and Textures Making your entity interesting.
Homogeneous Form, Introduction to 3-D Graphics Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 20,
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.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
10/3/02 (c) 2002 University of Wisconsin, CS 559 Last Time 2D Coordinate systems and transformations.
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Advanced Computer Graphics Shadow Techniques CO2409 Computer Graphics Week 20.
The Camera Course Information CVG: Programming 4 My Name: Mark Walsh Website: Recommended Reading.
Mark Nelson 3d projections Fall 2013
Point Sprites Course Information CVG: Programming 4 My Name: Mark Walsh Website: Recommended.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Image-based Rendering Ref: RTRv2. 2 Introduction Sprite, billboard, overview.
Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
Computer Graphics Imaging Lecture 13 and 14 UV Mapping.
- Review the following scene: REFLECTION  is the change in direction of a light ray when it bounces off a surface For an observer standing beside the.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
Final Presentation CS491B ALAIN VINIOT DE LARA Spring 2007, CSULA.
Introduction to Computer Graphics
- 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.
Computer Graphics Imaging
POLYGON MESH Advance Computer Graphics
Image-Based Rendering
CSCE 441 Computer Graphics 3-D Viewing
CSC461: Lecture 18 Classical Viewing
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
Graphics Processing Unit
Stylized Environmental Rendering
CS451Real-time Rendering Pipeline
CSCE 441: Computer Graphics Hidden Surface Removal
Computer Animation Texture Mapping.
Computer Graphics 4Practical Lesson
Viewing (Projections)
Computer Graphics Material Colours and Lighting
Week 11 - Monday CS361.
Presentation transcript:

Sky Boxes and Vector Math 2 Course Information CVG: Programming 4 My Name: Mark Walsh Website: Recommended Reading Introduction to 3D Game Programming with DirectX 9.0 (Frank D. Luna)

Sky Boxes: Introduction A skybox is a method to easily create a background to make a computer and video games level look bigger than it really is, by creating the illusion of distant three-dimensional surroundings A skydome employs the same concept but uses either a sphere or a hemisphere instead of a cube A sky box is a simple way to put 360 degrees of background around the user

Skybox Advances Processing of 3D graphics is very costly Levels have to be processed at tremendous speeds, making it difficult to render vast skyscapes in real- time Due to the nature of computer graphics, objects at large distances suffer from floating point errors, causing levels to have strong limits on their extents.

To compensate for these problems, games often employ skyboxes As a viewer moves through a 3-D scene, it is common for the skybox to remain stationary with respect to the viewer This technique gives the skybox the illusion of being very far away since other objects in the scene appear to move, while the skybox does not. This imitates real life, where distant objects such as clouds, stars and even mountains appear to be stationary when the viewpoint is displaced by relatively small distances. Effectively, everything in a skybox will always appear to be infinitely distant from the viewer

Advanced Skyboxes The default skybox had disadvantages It could not be animated and all objects in it appeared to be infinitely distant, even if they were close-by In the late 1990s, some GDs built small amounts of 3D geometry to appear in the skybox to create a better illusion of depth, in addition to a traditional skybox for objects very far away. This constructed skybox was placed in an unreachable location, typically outside the bounds of the playable portion of the level, to prevent players from entering the skybox.

In older versions of this technology, such as presented in the game Unreal this was limited to movements in the sky, such as the movements of clouds Elements could be changed from level to level The skybox in this game would still appear to be infinitely far away as the skybox did not move the viewing point along with the player movement through the level.

Newer engines, such as the Source engine, continue on this idea, allowing the skybox to move along with the player, although at a different speed Making the skybox move slower than the level causes the skybox to appear far away, but not infinitely The skybox actually is constructed almost as a miniature complete with its own skybox to maintain the illusion of an infinitely far sky This miniature is often at a scale (the Source engine typically uses 1/16th) to compensate for the floating point errors.

In the game Half-Life 2 this effect was extensively used in showing The Citadel In the later half of the game, the player would eventually travel through the city towards the Citadel, the skybox effect making it grow larger and larger progressively with the player movement In some instances, the Citadel is broken into 2 pieces A small lower section is a part of the main map, while the upper section is in the skybox. The two sections are seamlessly blended together to appear as a single structure

The simplest way to make one is to create six faces of a cube, textured on the inside We often use the flexible vertex format (FVF) The exact vertex format is up to you; it only must have position and tex coords Some people add normals (A surface normal, or simply normal, to a flat surface is a vector which is perpendicular to that surface) and more

Rendering Order When you begin to render a frame, determine which faces are visible Turn off lighting and z-buffering Rotate the faces to match the player (or camera) rotation, and draw them.

Metaphorically, this is a cube centred on the player (camera) that moves with him, but has fixed rotation (so the user can rotate within). In other words, assuming you've got a player's position and rotation, apply the rotation but NOT the position to the WORLD transform before drawing.

1. The vertex winding is backwards from a normal cube, since the textures will be viewed from INSIDE (this matters if you're using culling only) 2. The size of the cube is irrelevant, so long as every pixel of it is always within the clipping area (between the front and back clipping planes). Its distance doesn't matter because the z-buffer is off, so everything rendered after the sky box goes right over it anyway.

XFiles and SkyBoxes It is possible to load a skybox from an X- File. The skybox is defined in the x file as a cube with its insides textured with the sky and some sea. A skybox can therefore be loaded in exactly the same way as other.x files The difference in implementation comes in the render function.

Rendering the Skybox The view matrix is set each time the camera moves so when we come to render our skybox we need to: Remember the current view matrix. To do this we can use the GetTransform function. Change its position so the skybox is centred over us Set the world matrix to identity Render the skybox as we would for a normal.x file Restore the original view matrix

The End