Time for action — adding a rock texture

For this example, we are going to use another texture. Otherwise, we wouldn't see the effect of this texture mode:

  1. Create a new material similar to the previous one, except change the used texture to: terr_rock6.jpg:
    material MyMaterial3
    {
    technique
    {
    pass
    {
    texture_unit
    {
    texture terr_rock6.jpg
    }
    }
    }
    }
    
  2. Change the used material from MyMaterial1 to MyMaterial3:
    manual->begin("MyMaterial3", RenderOperation::OT_TRIANGLE_LIST)
    
  3. Compile and run the application. You should see a quad covered in a rock texture.
    Time for action — adding a rock texture

What just happened?

This time, the quad seems like it's covered in one single texture. We don't see any obvious repetitions like we did with the plant texture. The reason for this is that, like we already know, the texture wrapping mode repeats. The texture was created in such a way that at the left end of the texture, the texture is started again with its right side and the same is true for the lower end. This kind of texture is called seamless. The texture we used was prepared so that the left and right side fit perfectly together. The same goes for the upper and lower part of the texture. If this wasn't the case, we would see instances where the texture is repeated.

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

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