SlideShare ist ein Scribd-Unternehmen logo
1 von 70
Downloaden Sie, um offline zu lesen
Using Monocular Cues to
Program an Illusion of Depth
John Pile Jr
21 September 2013

Art by Geoff Gunning
John Pile Jr
The Game Studio @
Champlain College
Published Platforms:
iOS, Android, Xbox360, PS3, PC
Courses I teach:
• Graphics Programming (2D & 3D)
• Game Physics
• Game Networking
• Game Consoles Development

pile@champlain.edu

http://JohnPile.com
@JohnPile
Published by AK Peters | CRC Press: May 2013
The Game Studio:
Degree

School/Division

Game Artists
Game Designers
Game Programmers
Game Managers

Art
Creative Media
Comp. Sci. & Soft. Eng.
Business

Champlain College:
The Game Studio:
Game Programming:

2000
450
115
Today:
lots of concepts
a little sample code

short live demo
Role of Programmer in Art?

“Programmer Art”
Role of Programmer in Art?

http://sheilanash.com/
Role of Programmer in Art?
• Solve Problems & Create Solutions
Role of Programmer in Art?
• Solve Problems & Create Solutions
• Programmers have created:
– Painting Tools (Photoshop, GIMP, & MS Paint)
– Image Converters & Texture Packers
– 3D Editors (Autocad, Maya, & Z-Brush)
– Engines (Game Maker, Unity, UDK, & Flash)
Role of Programmer in Art?
In order to successfully

create solutions
we must understand the business
(at some level)
Role of Programmer in Art?
Using Monocular Cues
to program an illusion of depth
in 2D games
Concept: Sprites in 2D Games
Concept: Sprites in 2D Games

Not Much “depth”
Depth in Games
• Layering
– Background
Depth
• Layering
– Background
– Foreground
Depth
• Layering
– Background
– Foreground
• HUDs and GUIs
Traditional Role Playing Game (RPG)
Modern RPG
Gameplay
Rendered Cockpit
Implied Cockpit
MiniMaps, Compass, & Directional
Minimalist
Safe Frame / Safe Area = 90% of Screen Size

Safe Area / Frames
Depth Perception
Binocular Cues

&
Monocular Cues
Binocular Cues

Stereopsis: View the same image
from different angles.
Monocular Cues
Provide information on depth when
viewing a scene with one eye.
Depth through Monocular Cues
• Overlap (Layering)
– Background, Foreground, HUD, GUI
– In-game Objects
Overlapping
Depth through Monocular Cues
• Overlap
• Base Height
Base Height
in Egyptian artwork
Base Height
In traditional
perspective
artwork.
Base Height
In Games
Base Height
In Games
Base Height Indicated by Shadows
Depth through Monocular Cues
• Overlap
• Base Height
• Scale
Scale
Scale (without Base Height)
Scale and Base Height
Scale and Overlap

Problem?
Base Height + Overlap
Base Height + Overlap + Scale
Depth through Monocular Cues
•
•
•
•

Overlap
Base Height
Scale
Atmospheric Effects
Atmospheric Effects
Depth through Monocular Cues
•
•
•
•
•
•

Overlap
Base Height
Scale
Atmospheric Effects
Focus or “out-of-focus blur”
Parallax
Out-of-focus Blur & Depth of Field
Out-of-focus Blur
Depth through Monocular Cues
•
•
•
•
•
•

Overlap
Base Height
Scale
Atmospheric Effects
Focus or “out-of-focus blur”
Parallax
Parallax
Without Parallax
With Parallax
Additional Monocular Cues
Highlights
Additional Monocular Cues
Highlights
& Shadows
Additional Monocular Cues
Highlights & Shadows
Additional Monocular Cues
Highlights & Shadows
Additional Note on Perspective
Additional Note on Perspective
Additional Note on Perspective
Depth in Code
Draw Order

(or)

Depth Value:

0.0f to 1.0f

Most Distant
= 0.0f
Everything Else ~
Closest
= 1.0f
Overlap in Code
0.0f

1.0f

horizon
= 200;
screenHeight = 720;
depth
= ((position.Y - horizon) / (screenHeight - horizon));
Overlap in Code
screenHeight = 720;
horizon
= 200;
depth
= ((position.Y - horizon) / (screenHeight - horizon));

NOTE: You’ll need to know the base position!
Calculate Scale from Depth Value
• Perspective
– Scale:

0.25f

1.0f

scale = 0.25f + (depth * 0.75f);
Calculate Color from Depth Value
• Perspective
– Atmospheric Effects

float tempColor = 0.75f + (depth * 0.25);
tempColor = new Color(tempColorX, tempColorX, tempColorX);
Parallax from Depth
• Perspective

0.5f

– Parallax
1.0f

ViewPosition.X = 0.5f + (depth * 0.5f * ActualPosition.X);
ViewVelocity.X = 0.5f + (depth * 0.5f * ActualVelocity.X);
Depth

Example Program
Questions?
John Pile Jr
pile@champlain.edu

http://JohnPile.com
@JohnPile
Published by AK Peters | CRC Press: May 2013

Weitere ähnliche Inhalte

Was ist angesagt?

PaulTanompong_Resume_2015
PaulTanompong_Resume_2015PaulTanompong_Resume_2015
PaulTanompong_Resume_2015
Paul Tanompong
 
Pre Production 3
Pre Production 3Pre Production 3
Pre Production 3
GNBCEC
 

Was ist angesagt? (18)

The invasion of the golden coins
The invasion of the golden coinsThe invasion of the golden coins
The invasion of the golden coins
 
7. evaluation
7. evaluation7. evaluation
7. evaluation
 
Prototyping
PrototypingPrototyping
Prototyping
 
OGDC2013_2D Artist-the first steps_ Ms Tran Thi Thu Hien
OGDC2013_2D Artist-the first steps_ Ms Tran Thi Thu HienOGDC2013_2D Artist-the first steps_ Ms Tran Thi Thu Hien
OGDC2013_2D Artist-the first steps_ Ms Tran Thi Thu Hien
 
PaulTanompong_Resume_2015
PaulTanompong_Resume_2015PaulTanompong_Resume_2015
PaulTanompong_Resume_2015
 
Are we auteurs?
Are we auteurs?Are we auteurs?
Are we auteurs?
 
Games design elements
Games design elementsGames design elements
Games design elements
 
2. research(3) 2
2. research(3) 22. research(3) 2
2. research(3) 2
 
Game Design as Career
Game Design as CareerGame Design as Career
Game Design as Career
 
Game design as a career
Game design as a career Game design as a career
Game design as a career
 
Pre Production 3
Pre Production 3Pre Production 3
Pre Production 3
 
HOW TO CREATE A GAME DESIGN?
HOW TO CREATE A GAME DESIGN?HOW TO CREATE A GAME DESIGN?
HOW TO CREATE A GAME DESIGN?
 
Level design
Level designLevel design
Level design
 
3. research
3. research3. research
3. research
 
Computer Games Development Chapter 7
Computer Games Development Chapter 7Computer Games Development Chapter 7
Computer Games Development Chapter 7
 
Road blocks
Road blocksRoad blocks
Road blocks
 
Martin g wk9_final portfolio
Martin g wk9_final portfolioMartin g wk9_final portfolio
Martin g wk9_final portfolio
 
Martin g wk10_final portfolio_v2
Martin g wk10_final portfolio_v2Martin g wk10_final portfolio_v2
Martin g wk10_final portfolio_v2
 

Ähnlich wie John Pile Jr - Using Monocular Cues to Program an Illusion of Depth in 2D Games

Course Presentation: Games design
Course Presentation: Games designCourse Presentation: Games design
Course Presentation: Games design
Brunel University
 
GAME 3400 Level Design - Introduction
GAME 3400 Level Design - IntroductionGAME 3400 Level Design - Introduction
GAME 3400 Level Design - Introduction
Seth Sivak
 
iBasket: The story of an HTML5 game
iBasket: The story of an HTML5 gameiBasket: The story of an HTML5 game
iBasket: The story of an HTML5 game
Iker Jamardo
 

Ähnlich wie John Pile Jr - Using Monocular Cues to Program an Illusion of Depth in 2D Games (20)

Super Gun Kids: The Making Of by Iain Lobb
Super Gun Kids: The Making Of by Iain LobbSuper Gun Kids: The Making Of by Iain Lobb
Super Gun Kids: The Making Of by Iain Lobb
 
Game Development
Game DevelopmentGame Development
Game Development
 
Introduction to Game Development
Introduction to Game DevelopmentIntroduction to Game Development
Introduction to Game Development
 
Introduction to game development
Introduction to game developmentIntroduction to game development
Introduction to game development
 
Cocos2d game programming 1
Cocos2d game programming 1Cocos2d game programming 1
Cocos2d game programming 1
 
The Use of Modern Controller Devices at Schools: Game-Based Learning with the...
The Use of Modern Controller Devices at Schools: Game-Based Learning with the...The Use of Modern Controller Devices at Schools: Game-Based Learning with the...
The Use of Modern Controller Devices at Schools: Game-Based Learning with the...
 
Engineering Fun in Game Design
Engineering Fun in Game DesignEngineering Fun in Game Design
Engineering Fun in Game Design
 
Educational Games Design (STEG10 Keynote)
Educational Games Design (STEG10 Keynote)Educational Games Design (STEG10 Keynote)
Educational Games Design (STEG10 Keynote)
 
Showcase of My Research on Games & AI "till the end of Oct. 2014"
Showcase of My Research on Games & AI "till the end of Oct. 2014"Showcase of My Research on Games & AI "till the end of Oct. 2014"
Showcase of My Research on Games & AI "till the end of Oct. 2014"
 
Course Presentation: Games design
Course Presentation: Games designCourse Presentation: Games design
Course Presentation: Games design
 
Kodu game design
Kodu game designKodu game design
Kodu game design
 
OpenXcell Studio Webinar: From Concept to Development - How Does Mobile Game ...
OpenXcell Studio Webinar: From Concept to Development - How Does Mobile Game ...OpenXcell Studio Webinar: From Concept to Development - How Does Mobile Game ...
OpenXcell Studio Webinar: From Concept to Development - How Does Mobile Game ...
 
Lecture 1 Introduction to VR Programming
Lecture 1 Introduction to VR ProgrammingLecture 1 Introduction to VR Programming
Lecture 1 Introduction to VR Programming
 
Sutd Game Lab's prototyping tips
Sutd Game Lab's prototyping tipsSutd Game Lab's prototyping tips
Sutd Game Lab's prototyping tips
 
Phillip Heckinger (Microsoft): Empowering AR & VR with Tech Art
Phillip Heckinger (Microsoft): Empowering AR & VR with Tech ArtPhillip Heckinger (Microsoft): Empowering AR & VR with Tech Art
Phillip Heckinger (Microsoft): Empowering AR & VR with Tech Art
 
Gamemaker - Intro and Core Objects
Gamemaker - Intro and Core ObjectsGamemaker - Intro and Core Objects
Gamemaker - Intro and Core Objects
 
GAME 3400 Level Design - Introduction
GAME 3400 Level Design - IntroductionGAME 3400 Level Design - Introduction
GAME 3400 Level Design - Introduction
 
Meta 3D Studios Art Experience
Meta 3D Studios Art ExperienceMeta 3D Studios Art Experience
Meta 3D Studios Art Experience
 
iBasket: The story of an HTML5 game
iBasket: The story of an HTML5 gameiBasket: The story of an HTML5 game
iBasket: The story of an HTML5 game
 
Anton Velmozhniy: Pheus and Mor Postmortem
Anton Velmozhniy: Pheus and Mor PostmortemAnton Velmozhniy: Pheus and Mor Postmortem
Anton Velmozhniy: Pheus and Mor Postmortem
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

John Pile Jr - Using Monocular Cues to Program an Illusion of Depth in 2D Games