2010.4.8. Overview  Basic requirements of implementation  Image resource  Texture mapping  Advanced requirements of implementation  KGL sprite class.

Slides:



Advertisements
Similar presentations
CSE 380 – Computer Game Programming Tile Based Graphics Legend of Zelda, by Nintendo, released 1987.
Advertisements

Using 2D sprite with OpenGL 2003 team Koguyue. Overview Motivation and basic concepts Advantages with using OpenGL Basic requirements of implementation.
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
Graphics Pipeline.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
Projective Texture Mapping
Texture Mapping. Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can.
Computer Graphics Visible Surface Determination. Goal of Visible Surface Determination To draw only the surfaces (triangles) that are visible, given a.
3.1. G RAPHICS I The use of images within games. Reflections and advice on the games proposed in the Week 2 Hand-in.
MAT 594CM S2010Fundamentals of Spatial ComputingAngus Forbes Overview Today: - Make sure everyone is set up with an OpenGL environment - OpenGL basics:
High-Quality Video View Interpolation
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 12 Chapter 12: Making the Applications Interesting.
Introduction to OpenGL. What is OpenGL OpenGL is a low-level software interface to graphics hardware No commands for performing windowing tasks or obtaining.
© Siemens Product Lifecycle Management Software Inc. All rights reserved Siemens PLM Software Solid Edge ST5 Training Exploding assemblies.
Sprite Batching and Texture Atlases Randy Gaul. Overview Batches Sending data to GPU Texture atlases Premultiplied alpha Note: Discussion on slides is.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Beyond Meshes Spring 2012.
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
9/20/2001CS 638, Fall 2001 Today Finishing Up Reflections More Multi-Pass Algorithms Shadows.
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
Computer Graphics Mirror and Shadows
CS 638, Fall 2001 Today Light Mapping (Continued) Bump Mapping with Multi-Texturing Multi-Pass Rendering.
CSE 380 – Computer Game Programming Sprite Animation
Computer Graphics Texture Mapping
Lecture 8: Texture Mapping 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271
Texture Mapping. Introduction What is Texture Mapping? Types of Texture Mapping –1D, 2D and 3D SDL and OpenGL.
CS 4363/6353 TEXTURE MAPPING PART II. WHAT WE KNOW We can open image files for reading We can load them into texture buffers We can link that texture.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 7 The Game Loop and Animation Starting Out with Games & Graphics.
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.
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources CSCI 6360/4360.
3D Graphics for Game Programming Chapter IV Fragment Processing and Output Merging.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Module Code: CU1025NI 3D Modelling and Animation Basics Week - 2.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Control flow for interactive applications CSE 3541 Matt Boggus.
Review 2 – Adobe Flash Lab Manual
Texture Mapping CAP4730: Computational Structures in Computer Graphics.
CSE 381 – Advanced Game Programming GLSL. Rendering Revisited.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Lesson 3: Arrays and Loops. Arrays Arrays are like collections of variables Picture mailboxes all lined up in a row, or storage holes in a shelf – You.
Cel shading By jared brock.
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
Super EastGate Jon Caron, Ryan Fleming, Antonio Guarino, and Mike LoVerme Merrimack College Introduction Super EastGate is a 2D side scroller game that.
Image-based Rendering Ref: RTRv2. 2 Introduction Sprite, billboard, overview.
11/24/ :45 Graphics II Shadow Maps Reflections Session 5.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
Feature Film Production Using 3D Computer Animation.
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.
Today, we'll learn how to animate our artwork
Textures, Sprites, and Fonts
Textures, Sprites, and Fonts
Buffers Ed Angel Professor Emeritus of Computer Science
Discrete Techniques.
Draw a Simple Object.
Photorealistic Rendering vs. Interactive 3D Graphics
The Graphics Rendering Pipeline
Introduction to Computer Graphics with WebGL
Making the Applications Interesting
2.02C Frame-by-Frame Computer Animation Using PowerPoint
Solid Edge ST4 Training Exploding assemblies
Computer Graphics Buffers
Computer Graphics 4Practical Lesson
Buffers Ed Angel Professor Emeritus of Computer Science
Transparency & magic pixel
Computer Graphics Introduction to Shaders
COS 125 Day 5.
COS 125 Day 5.
Frame Buffer Applications
Game Programming Algorithms and Techniques
Frame Buffers Fall 2018 CS480/680.
Presentation transcript:

Overview  Basic requirements of implementation  Image resource  Texture mapping  Advanced requirements of implementation  KGL sprite class & example  Demo

Basic requirements of implementation ( 1/2 )  Load image files that you need, transform their data into OpenGL and bind them in a proper way  Image color keying for background removal background to remove character to draw original image background removal zoom in color keying

Basic requirements of implementation ( 2/2 )  Hold the position and size of the sprite, and so we can move it or span it freely  By controlling the texture coordinates, we can play a sequence of animation frames in a same image Time t0 Time t0+1

Image resource  Multiple images or Texture Atlas Four Image with difference Texture ID Packing all texture in one atlas Swap Texture ID in timer Swap Texture coord. in timer

Image resource  Multiple images or Texture Atlas Packing all texture in one atlas Swap Texture ID in timer Swap Texture coord. in timer Four Image with difference Texture ID

Image resource  Multiple images or Texture Atlas Packing all texture in one atlas Swap Texture ID in timer Swap Texture coord. in timer Four Image with difference Texture ID

Image resource  Multiple images or Texture Atlas Packing all texture in one atlas Swap Texture ID in timer Swap Texture coord. in timer Four Image with difference Texture ID

Texture mapping (0, 1) (0, 0) (1, 1) (1, 0) texture The coordinate of a texture is normalized into an 2d unit square (0.36, 0) (0, 0.45) (0.36, 0.45)

Advanced requirements of implementation ( 1/2 )  ( In this section, we take more from OpenGL )  Taking advantage of alpha buffer and depth buffer, we can happily create the effect of transparency with little effort This effect alpha blending is a standard function in OpenGL To use it, it is necessary to set frame color buffer as RGBA The value of alpha to form different level of transparency can be set both in image data and in color4 value

Another things…  Again, we control the texture coordinates to add the function of scrolling the image  It is convenient and useful to perform some small sprite automatic action if we add a frame ( or time ) counter into it In this example, a sprite of spotlight is drawn over a sprite of wall texture, and the spot light is controlled to scroll again and again

KGL sprite class

KGL sprite example(1/2) KFLoadText() will return the index of the texture we load

KGL sprite example(2/2) mapping the texture onto a quad

Demo Sequentially load the textures below, then it will become an animation