--Chapter 7: Light—
The next important thing about Citro3D homebrew is light and the light effects in the 3D space. It defines the ambience and the effects used in any 3D homebrew.
The first thing you’ll want to do is set your values (ambient, diffuse, emission, etc.) and we’ll go over each of them now. Here’s the code:
static const C3D_Material material =
{
{ 0.2f, 0.2f, 0.2f }, //ambient, values go by BGR, not RGB
{ 0.4f, 0.4f, 0.4f }, //diffuse
{ 0.8f, 0.8f, 0.8f }, //specular0
{ 0.0f, 0.0f, 0.0f }, //specular1
{ 0.0f, 0.0f, 0.0f }, //emission
};
The first value is the ambient value. What this value does is change the color of every object in the current scene. If you were to set the color value of the ambient’s green value to 0.5 and left the rest 0.0, every object should be green.
Next comes the diffuse value, which is like the ambient value, but instead of having the color shade over the object, it makes it a solid color. Taking our last example, the ambient value would make the green a light shade, while the diffuse value would make it a solid green.
Then comes the specular0 value, which is the spotlight that appears on the cube (seen in the example later), and the specular1 value, which is just like emission, except emission gives the object a light to it.
Now we start editing the code itself.