11 Lecture 3 Particle Effects References: [1] Gregory Junker, Pro OGRE 3D Programming, Apress, 2006 [2] Ogre Tutorials – Ogre Wiki

Slides:



Advertisements
Similar presentations
1.1 Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. Al-Azhar University
Advertisements

Lecture 14 User-defined functions Function: concept, syntax, and examples © 2007 Daniel Valentine. All rights reserved. Published by Elsevier.
Game Programming 09 OGRE3D Lighting/shadow in Action
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
4.9. P ARTICLE E FFECTS Use of particle effects within games.
Motivation Hair animation used in movies, games, virtual reality, etc. Problem due to complexity –Human head has over 100,000 strands of hair –Computation.
UFCFX5-15-3Mobile Device Development Particle Systems.
1Notes  Textbook: matchmove 6.7.2, B.9. 2 Match Move  For combining CG effects with real footage, need to match synthetic camera to real camera: “matchmove”
UFCEKT-20-33D Modelling and Animation 3D Modelling & Animation Lighting.
Intro to Simulation and Virtual reality – CE ► An overview of VR and simulation ► Practical application of theory ► Module Leader - Bob Hobbs ►
1 2. Controlling Robot Car in Ogre References: 1. LEGO.com MINDSTORMS NXT Home, 2. OGRE 3D, 3. MSDN,
Useful Tools for Making Video Games Part I An overview of Ogre.
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
1 5. Video Object Tracking and Processing To achieve augmented reality, computer generated graphics should be shown together with the live video In addition,
WSN Simulation Template for OMNeT++
Ch 1 Intro to Graphics page 1CS 367 First Day Agenda Best course you have ever had (survey) Info Cards Name, , Nickname C / C++ experience, EOS experience.
1 References: 1. J.M. Hart, Windows System Programming, 4th Ed., Addison-Wesley, 2010, Ch.12 2.Microsoft Kinect SDK for Developers,
Introduction.  What is the 3D graphics.  Applications of 3D Graphics.  What is 3Ds MAX.?  System requirements for 3Ds max.  Components of 3Ds MAX.
CS 445 / 645: Introductory Computer Graphics
Games Development 2 Entity / Architecture Review CO3301 Week
Physically Based Animation and Modeling
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
Modelling and Simulation Dynamics. Dynamics Dynamics is a branch of physics that describes how objects move. Dynamic animation uses rules of physics to.
CSE 786 Game Presentation June 9, 2009 Game: “Little Robot’s Adventure” Team: OgreNoName Hiroshi Hayashi Bryan Linthicum Brett Kizer.
CS324e - Elements of Graphics and Visualization Checkerboard World.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
1 Lecture 2 Animation References: [1] Gregory Junker, Pro OGRE 3D Programming, Apress, 2006 [2] Ogre Tutorials – Ogre Wiki
Advanced Game Design Prof. Roger Crawfis Computer Science & Engineering The Ohio State University.
9.3. P ARTICLE S YSTEMS Development of a particle system.
1 Virtual Reality Modeling Language (VRML97) ©Anthony Steed
Web Games Programming An Introduction to Unity 3D.
Computer Science Term 1, 2006 Tutorial 3 Assignment 4 – Special Effects.
CSC505 Particle Systems. CSC505 Object Representations So far we have represented (rendered) objects with –Lines –Polygons (triangles) –Curves These techniques.
Particle Systems (Motion Machines of 2D Objects with Textures) Matthew K. Bowles Advanced Computer Graphics Spring 2004.
CS 450: COMPUTER GRAPHICS PROJECTIONS SPRING 2015 DR. MICHAEL J. REALE.
CS324e - Elements of Graphics and Visualization Java 3D Intro.
Game Design and Dev Ogre3D Overview
Course Introduction to virtual engineering Óbuda University John von Neumann Faculty of Informatics Institute of Applied Mathematics Lecture and laboratory.
Point Sprites Course Information CVG: Programming 4 My Name: Mark Walsh Website: Recommended.
Computer Graphics Blending CO2409 Computer Graphics Week 14.
Chipmunk Physics Remember that we talked about this a bit when we did collision handlers for the space ship integration task (SpritesActionsPhysicsSound).
Games Development 1 Review / Revision CO2301 Games Development 1 Semester 2.
Derived from Kirill Muzykov’s Rocket Mouse Tutorial WakeUpAndCode.com.
Lighting a 3D Scene Guilford County Sci Vis V part 1.
1 Lecture 5: Interactive Tools: Prototypers (HyperCard, Director, Visual Basic), Interface Builders Brad Myers Advanced User Interface Software.
UniS CS297 Graphics with Java and OpenGL Blending.
Local Illumination and Shading
Portal & Particle. Index Portal Particles Portal Room-Portal visibility system  Determine which room is shown at this time  Determine which object.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Graphics for Games Particle Systems CO2301 Games Development 1 Week 23.
Copyright © Curt Hill Meshes A Little More to Know.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
UFCFSU-30-13D Technologies for the Web An Introduction to Unity 3D.
Unbuffered Input Games generally use unbuffered Input Ogre provides FrameListeners – Ogre's main infinite loop → startRendering – Also called the render.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Chapter 5. Lighting Computer Graphics (spring, 2009) School of Computer Science University of Seoul.
More (C#) Scripting Day 2, Lesson 1.
Introduction to Graphics Modeling
Computer Animation Ying Zhu Georgia State University
© 2002 University of Wisconsin
Computer Graphics Imaging Ying Zhu Georgia State University
Blender API: Part 2: Game Engine
CO1301: Games Concepts Lecture 22 Particle Systems
Computer Graphics Lecture 15.
Particle Systems - A Technique for Modeling a Class of Fuzzy Objects
CO Games Concepts Week 22 Particle systems
Use of particle effects within games
Games Development 1 Review / Revision
Games Development 2 Entity / Architecture Review
Presentation transcript:

11 Lecture 3 Particle Effects References: [1] Gregory Junker, Pro OGRE 3D Programming, Apress, 2006 [2] Ogre Tutorials – Ogre Wiki [3] [4]Microsoft MSDN, C++ reference EIE360 Integrated Project Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun

22 Architecture of the Interactive Virtual Aquarium System Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun USB port 3D Graphics System 3D Graphics Your program Your program Network Computer A Computer B Kinect Sensor Device

33 Particle Effects in OGRE Particle systems are the foundation of most visual special effects in a 3D application They refer to the kind of computer graphics techniques to simulate certain fuzzy phenomena They are otherwise very hard to reproduce with conventional rendering techniques These fuzzy phenomena include bubbles, fire, smoke, explosion, snow, … Fireball Bubbles Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun

4 Particle System Templates Particle systems are typically script based to enable fast prototyping and iteration Users only need to change the data in a script file in order to change the behavior of a particle system Templates are used to standardize the script files Can be reused to create multiple particle systems that are similar Some major items in a template Basic – the basic setup information of the particle system Emitters – define how the particles are emitted Affectors – define the particles’ path and lifetime once emitted 4 Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun

5 A Typical Template particle_system EIE360/Explosion { quota1000 material Examples/FlarePointSprite particle_width50 particle_height50 cull_eachfalse rendererbillboard sortedfalse local_spacetrue iteration_interval0 nonvisible_update_timeout 0 billboard_type oriented_common billboard_origincenter billboard_rotation_type texcoord common_direction0 1 0 common_up_vector0 1 0 point_renderingfalse accurate_facingfalse 5 emitter Point { angle180 colour colour_range_start colour_range_end direction0 1 0 emission_rate2000 position0 0 0 velocity300 velocity_min300 velocity_max300 time_to_live2.5 time_to_live_min2.5 time_to_live_max2.5 duration2 duration_min2 duration_max2 repeat_delay5 repeat_delay_min5 repeat_delay_max5 } affector LinearForce { force_vector } affector ColourFader { red-0.4 green-0.4 blue-0.1 alpha-0.5 } Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun

6 Template: Basics quota Particle systems cannot emit particles without bound Need to specify a quota Will stop emitting particles when quota has been used up 6 material Need to define how each particle is composed E.g., an explosion can be composed by many flare light points of different colors The definition of materials is stored in a script file Many material examples script files can be found in media/materials/scripts flare Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun

7 Template: Basic (cont) sorted Ogre can sort particles based on their distance from the camera Require heavy computation hence disable by default May be useful in some situation such as (excerpt from [1]): 7 Without sorting, we see the fire With sorting, the smoke obscures the fire Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun

8 Template: Basic example 8 particle_system EIE360/Explosion { quota1000 material Examples/FlarePointSprite particle_width50 particle_height50 cull_eachfalse rendererbillboard sortedfalse local_spacetrue iteration_interval0 nonvisible_update_timeout 0 billboard_typeoriented_common billboard_origincenter billboard_rotation_type texcoord common_direction0 1 0 common_up_vector0 1 0 point_renderingfalse accurate_facingfalse Many flare light points of large size Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun

9 Template: Emitters In the context of particle systems, an emitter is an object that emits particle. A few emitters can be found in Ogre point emitters box emitters cylinder emitters ellipsoid emitters hollow ellipsoid emitters emit from the shell of an ellipsoidal volume ring emitters emit from the edges of a planar ring The rate, velocity, and direction in which particles are emitted are completely configurable 9 Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun

10 Template: Emitters (cont) angle and direction Particles are usually emitted in a “cone” around the direction of the emitter The size of the cone is defined by “angle” If “angle” = 0, emit particle in a straight line If “angle” = 180, emit in all directions If “angle” = 90, emit in a hemisphere around the direction vector The direction is defined by “direction” “direction” = 0 1 0, means parallel to the y-axis 10 Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun

11 Template: Emitters example 11 emitter Point { angle180 colour colour_range_start colour_range_end direction0 1 0 emission_rate2000 position0 0 0 velocity300 velocity_min300 velocity_max300 time_to_live 2.5 time_to_live_min 2.5 time_to_live_max 2.5 duration2 duration_min2 duration_max2 repeat_delay5 repeat_delay_min 5 repeat_delay_max 5 } flare light points emitted in all directions Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun

12 Template: Affectors Affectors affect the particles’ path and lifetime once they are emitted into the game world Can impose “gravity”, “wind” on particles Can define particles that will change color after emission LinearForce Apply a force to the particles The particles will drift following the direction of the force after emission E.g. force_vector defines a force vector that forces the particles falling onto the ground after emission 12 Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun

13 Template: Affectors (cont) ColorFader Modify a particle’s color while it exists The color definition is in terms of “component change per second” E.g. The following code will fade the color by 0.5 each second (the max and min value are 1 and 0, resp) 13 affector ColourFader { red -0.5 green -0.5 blue -0.5 alpha -0.5 } Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun

14 Template: Affectors example 14 affector LinearForce { force_vector } affector ColourFader { red-0.4 green-0.4 blue-0.1 alpha-0.5 } All flare light points will fall onto the ground Color will change and disappear at the end Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun

Template: Affectors example 15 Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun affector DeflectorPlane { plane_point plane_normal bounce0 } Define an invisible plane at point (0, 300, 0) with normal equal to -1 (0, 300, 0) X Normal = -1 Means all particles will go thru the plane without bouncing back

16 Particle Editor For fast prototyping of particle systems, an application ParticleEditor is provided by the Ogre community Allow real time visualization of the particle effect with changes in parameters 16 Can be downloaded from Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun

17 Introducing Particle Systems to the Aquarium 17 Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun Ogre::ParticleSystem *bubblesParticle = mSceneMgr->createParticleSystem(“Bubbles”, “EIE360/Bubbles”); mBubblesNode = mSceneMgr->getRootSceneNode()-> createChildSceneNode("BubblesNode"); //Node name mBubblesNode->attachObject(bubblesParticle); mBubblesNode->setPosition(Ogre:: Vector3(0, -20, -50)); //Position of the bubbles Assume the following variable is defined: Then create a ParticleSystem with the particle effect Bubbles defined in EIE360/Bubbles Create a scene node and attach the ParticleSystem to it SceneNode * mBubblesNode

An example … 18 Department of ELECTRONIC AND INFORMATION ENGINEERING 3. Particle Effects by Dr Daniel Lun