Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Lua Game Development Cookbook

You're reading from   Lua Game Development Cookbook Over 70 recipes that will help you master the elements and best practices required to build a modern game engine using Lua

Arrow left icon
Product type Paperback
Published in Jul 2015
Publisher
ISBN-13 9781849515504
Length 360 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Mário Kašuba Mário Kašuba
Author Profile Icon Mário Kašuba
Mário Kašuba
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Lua Game Development Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Basics of the Game Engine FREE CHAPTER 2. Events 3. Graphics – Common Methods 4. Graphics – Legacy Method with OpenGL 1.x–2.1 5. Graphics – Modern Method with OpenGL 3.0+ 6. The User Interface 7. Physics and Game Mechanics 8. Artificial Intelligence 9. Sounds and Networking Index

Creating texture atlas with the rover-design pattern


Texture management becomes important with increasing the number of textures. An intuitive approach of using different OpenGL texture objects for each game texture presents the major bottleneck with rapid texture switching. That's because every time you change active texture unit, the graphic card needs to change its internal state. This problem can be eliminated using fewer larger textures that contain smaller images. This can be compared to a texture atlas where images are placed next to each other. These images can be accessed using different texture coordinates for every image.

Texture atlas can use evenly-spaced images with the same size or use some placement algorithm to place images of unequal sizes efficiently.

The first method was used in older games and is often used in games in which the images have the same size. Such texture atlas is often pregenerated to save the game loading time. Every time the game needs to use a different...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime
Visually different images