Time for action — changing the border color

  1. Copy the last material and name it MyMaterial7.
  2. After setting the texture mode, add the following line to set the border color to blue:
    tex_border_color 0.0 0.0 1.0
    
    
  3. Compile and run the application. This time, we also see only one leaf texture, but the rest of the quad should be in blue.
    Time for action — changing the border color

What just happened?

We changed the border color from black to blue. Similarly, we can use any color as the border color, which can be described with an RGB value. This texture mode can be used when putting logos onto objects like racing cars. We only need to set the border color to the color of the car and then add the texture. If there are little errors or inaccuracies with the texture coordinates, they won't show up because the car and the border color are the same.

Pop quiz — texture modes

  1. What is the difference between the four texture modes wrap, clamp, mirror, and border?

    a. How texture coordinates are used which have a value between 0 and 1

    b. How texture coordinates are handled that are lower or higher than the range of 0 to 1

    c. How the texture color is rendered

Have a go hero — Using texture modes

Try using texture coordinates that are larger than 2 or are negative.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.14.118