Time for action — scrolling a texture

Now that we have prepared our quad, let's scroll the texture:

  1. Add the following line into the texture block of the material to scroll the texture:
    scroll 0.8 0.8
    
  2. Compile and run the application. This time, you should see a different part of the texture.
    Time for action — scrolling a texture

What just happened?

The scroll attribute changes the texture coordinates with the given offset. The following is a diagram showing the effect of scrolling. The upper-right corner was the first part of the texture we rendered and the lower-left corner was the part of the texture we rendered with the scroll applied.

What just happened?

This attribute can be used to change the texture coordinates without the need for changing the UV coordinates of a model itself.

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

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