Game Development Reference
In-Depth Information
Building the game's main material
As the game is an iOS game, we should work with caution when adding elements and code
to save the game from any performance overhead, glitches, or crashes. Although the engine
can run a game with the Light option on an iOS device, I always prefer to stay as far away
as possible from using lights/directional lights in an iOS game, as a directional light source
on mealtime would mean recalculating all the vertices. So, if the level has 10k vertices with
two directional lights, it will be calculated as 30k vertices.
The best way to avoid using a light source for such a simple game like the brick breaking
game is to build a special material that can emulate a light emission; this material is called
an emissive material.
In your project panel, right-click in an empty space (perhaps inside the materials
folder) and choose a material from the Basic Assets section. Give this material a name
(which, in my case, is gameEmissiveMaterial ) and then double-click to open the material
editor.
As you can see, the material editor for a default new material is almost empty, apart from
one big node that contains the material outputs with a black colored material. To start
adding new nodes, you will need to right-click in an empty space of your editor grid and
then either select a node or search for nodes by name; both ways work fine.
The emissive material is just a material with Color and Emissive Color ; you can see these
names in your output list, which means you will need to connect some sort of nodes or
graphs to these two sockets of the material output.
Now, add the following three new nodes:
Search WWH ::




Custom Search