Book Image

Libgdx Cross-platform Game Development Cookbook

Book Image

Libgdx Cross-platform Game Development Cookbook

Overview of this book

Table of Contents (20 chapters)
Libgdx Cross-platform Game Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Avoiding unnecessary render calls with frustum culling


Rendering is the most essential operation within a video game. However, it is not a cheap process, as it requires sending data from memory to the GPU as well as a sequence of steps within your GPU to transform the input data into the final 2D image.

This input data consists of vertices that are no more than points with extra attached information, such as texture coordinates. They will serve as a base for constructing basic shapes.

The following is a summarized and simplified screenshot about this process:

Here is a brief but concise explanation:

  • Vertex shader: The main goal of this option is processing the aforementioned vertices. Additionally, it works as a walkway for later steps to receive important attributes such as color and texture coordinates.

  • Shape assembly: This option joins those vertices in order to form primitive shapes.

  • Geometry shader: This option evaluates the primitives passed from the previous step, and modifies them if...