3D Game Development Intro to Game Engines Engines Jay Urbain, - - PowerPoint PPT Presentation

3d game development intro to game engines engines
SMART_READER_LITE
LIVE PREVIEW

3D Game Development Intro to Game Engines Engines Jay Urbain, - - PowerPoint PPT Presentation

3D Game Development Intro to Game Engines Engines Jay Urbain, Ph.D. SE3250 OpenGL Programming Guide: http://www.glprogramming.com/red/ http://people.msoe.edu/~urbain/cs421/index.html http://jmonkeyengine.org Game engine


slide-1
SLIDE 1

3D Game Development – Intro to Game Engines Engines

Jay Urbain, Ph.D. SE3250

  • OpenGL Programming Guide: http://www.glprogramming.com/red/
  • http://people.msoe.edu/~urbain/cs421/index.html
  • http://jmonkeyengine.org
slide-2
SLIDE 2
  • System designed for the creation and development of video

games.

  • Software framework for developers.
  • Core functionality:

rendering engine for 2D or 3D graphics

Game engine

– rendering engine for 2D or 3D graphics – physics engine for collision detection/response – Sound – Scripting – Animation – AI – Networking, streaming, memory management, threading, localization support, and a scene graph.

slide-3
SLIDE 3
  • The process of game development is often economized, in large

part, by reusing/adapting the same game engine to create different games.

  • Select appropriate Game Engine from engine attributes

(previous slide).

Game engine

(previous slide).

  • Use Java Monkey (jME3) as exemplar.
slide-4
SLIDE 4

jMonkeyEngine (jME)

  • Game engine made for 3D development.
  • Uses shader technology extensively.
  • jMonkeyEngine is written in Java and uses LWJGL as its

default renderer. OpenGL 2 through OpenGL 4 is fully supported.

  • OpenGL 2 through OpenGL 4 is fully supported.
  • jMonkeyEngine is a collection of libraries, making it a low-

level game development tool.

  • Coupled with an IDE like the official jMonkeyEngine 3 SDK it

becomes a higher level game development environment with multiple graphical components (NetBeans).

slide-5
SLIDE 5

3D Graphics and Audio

  • OpenGL is the Open Graphics Library, a platform-independent

specification for rendering 2D/3D computer graphics.

  • Alternatively, Microsoft XNA is a set of tools and runtime

environment for video game development and management.

– XNA is based on .NET Compact Framework 2.0 for Xbox 360 development and .NET Framework 2.0 on Windows. development and .NET Framework 2.0 on Windows.

  • For Java, there are two implementations of OpenGL-based

renderers: – Lightweight Java Game Library (LWJGL) – jme3 uses lwjgl. – Java OpenGL (JOGL)

  • OpenAL is the Open Audio Library, a platform-independent 3D

audio API.

slide-6
SLIDE 6

jME -Context, Display, Renderer

  • Context makes settings, renderer, timer, input and event

listeners, display system, accessible to a game.

  • Display System is what draws the custom JME window

(instead of Java Swing).

  • The Input System is the component that lets you respond to
  • The Input System is the component that lets you respond to

user input: Mouse clicks and movements, keyboard presses, and joystick motions.

  • The Renderer is what does all the work of calculating how to

draw the 3D scenegraph to the 2D screen.

  • The Shader is a programmable part of the rendering pipeline.
slide-7
SLIDE 7

Scene Graph

  • Objects in a virtual space.
  • Virtual space where your game appears.
  • Objects in the scene graph are called spatials.
  • Spacials have a translation (location), rotation, and scale.

Locations in the scene graph are defined using X, Y, and Z

  • Locations in the scene graph are defined using X, Y, and Z

coordinates.

slide-8
SLIDE 8

Three Dimensions

slide-9
SLIDE 9

Translation

slide-10
SLIDE 10

Rotation

slide-11
SLIDE 11

Rotation

slide-12
SLIDE 12

Geometry

  • A geometry is the type of spatial that is visible
  • n the screen.
  • A geometry has a mesh to define its form and

a material to define its appearance. a material to define its appearance.

slide-13
SLIDE 13

Geometry

  • A geometry is the type of spatial that is visible on the screen.
  • A geometry has a mesh to define its form and a material to

define its appearance.

  • Geometry with and without material color.
slide-14
SLIDE 14

Nodes

  • Spacial that can have other spatials as children, i.e., a collection.
  • Children of the node are moved and rotated relative to their parent node.
  • The scene graph uses a base root node that all spatials are connected to.
slide-15
SLIDE 15

Nodes

  • Spacial that can have other spatials as children, i.e., a collection.
  • Children of the node are moved and rotated relative to their parent node.
  • The scene graph uses a base root node that all spatials are connected to.
slide-16
SLIDE 16

Nodes and Geometries

slide-17
SLIDE 17

Translate Geometry

slide-18
SLIDE 18

Child Geometry Relative to Node

slide-19
SLIDE 19

Translate Node

slide-20
SLIDE 20

Translate Node

slide-21
SLIDE 21

Rotate Node

slide-22
SLIDE 22

Rotate Geometry (child object)

slide-23
SLIDE 23

Rotate Geometry

slide-24
SLIDE 24

Rotate Node about Z-Axis

slide-25
SLIDE 25

Scale Node

slide-26
SLIDE 26

Scale Node

slide-27
SLIDE 27

Scale Child

slide-28
SLIDE 28

Scale Child

slide-29
SLIDE 29

Organizing with Nodes

slide-30
SLIDE 30

Geometry - Polygon, Mesh, Vertex

  • Most visible objects in a 3D scene are made up of polygon meshes – game

characters, terrains, buildings, etc.

  • A mesh is a grid-like structure that represents a complex shape.
  • Mathematically simple to render in real time, and detailed enough to be

recognizable. Every shape is reduced to a number of connected polygons, usually

  • Every shape is reduced to a number of connected polygons, usually

triangles; including round surfaces.

  • Polygons' corner points are called vertices.
  • Every vertex is positioned at a coordinate, all vertices together describe

the outline of the shape.

  • Create 3D meshes in tools called mesh editors, e.g in Blender, Maya.
  • jME can load finished meshes (models) and arrange them in scenes.
slide-31
SLIDE 31

Materials: Color, Lighting/Shading

  • “Color" is part of an object's light reflection.
  • Our brain uses shading and reflecting properties to infer an object's shape

and material.

  • Differentiate chalk & milk, skin & paper, water & plastic.
  • Ambient color

The uniform base color of the mesh – what it looks like when not – The uniform base color of the mesh – what it looks like when not influenced by any light source. – Usually similar to the Diffuse color. – Min. color you need for an object to be visible.

  • Diffuse color

– Base color of the mesh plus shattered light and shadows that are caused by a light source. – Usually similar to the Ambient color.

slide-32
SLIDE 32

Ambient Lighting

  • No light source – material color
slide-33
SLIDE 33

Light Sources - Emissive color

  • Emissive color

– The color of light emitted by a light source or glowing material. – Only glowing materials such as lights have an emissive color, normal

  • bjects don't have this property.

– Often white (sun light).

slide-34
SLIDE 34

Light Sources - Reflections

  • Reflections: Shininess

– Degree of shininess of a surface. – Shiny objects have small, clearly outlined specular highlights. (E.g. glass, water, silver) – Normal objects have wide, blurry specular

  • highlights. (E.g. metal, plastic, stone, polished
  • highlights. (E.g. metal, plastic, stone, polished

materials). – Uneven objects are not shiny and have no specular highlights. (E.g. cloth, paper, wood, snow) .

slide-35
SLIDE 35

Light Sources - Reflections

  • Reflections: Specular Color

– If the material is shiny, then the Specular Color is the color of the reflected highlights. – Usually the same as the emissive color of the light source (e.g. white). – You can use colors to achieve special specular effects, such as metallic

  • r iridescent reflections.
  • r iridescent reflections.

– Non-shiny objects have a black specular color.

slide-36
SLIDE 36

Materials: Textures

  • Simplest case: object has one texture, the Color Map, loaded from one

image file.

  • The more information you provide to the Color Map, the higher the

degree of detail and realism.

  • Whether you want photo-realistic rendering or "toon" rendering (Cel

Shading), everything depends on the quality of your materials and Shading), everything depends on the quality of your materials and textures.

  • Modern 3D graphics use several layers of information to describe one

material, each mapped layer is a texture.

slide-37
SLIDE 37

Color Map / Diffuse Map

  • A plain image file or a procedural texture that describes an
  • bject's visible surface.
  • The image can have alpha channels for transparency.
  • A Color Map is the minimum texture. You can map more

textures as optional improvements. textures as optional improvements.

  • Color Maps are unshaded. The same is called Diffuse Map in a

Phong-illuminated material, because this texture defines the basic colors of light that are diffused by this object.