In this section, will discuss how to apply colors to your cube object. We'll also learn how to create shader files for light and for a source of light such as a lamp. And then we'll learn how to add the cube and the light source to our game world.
So, let's begin by creating new shader files for the light and the lamp.
Here we'll learn how to create shader files for a light source and a lamp and explore the code that will go into the vertex shaders and the fragment shaders. Perform the following steps to learn how create these shader files:
- First of all, for rename
core.vs
andcore.frag
from the previous chapters tolighting.vs
andlighting.core
. - Now let's begin with the modifications to the code of these newly renamed files. First of all, we'll modify
lighting.vs
. What we're going to do here is get rid of the texture coordinate because we're not going to render a texture in here, and we'll also get rid of the...