Getting ready

Set up your program to generate a noise texture and make it available to the shaders through the uniform variable NoiseTex. There are three uniforms in the fragment shader that can be assigned from the OpenGL program. They are as follows:

  • LightWoodColor: The lightest wood color
  • DarkWoodColor: The darkest wood color
  • Slice: A matrix that defines the slice of the virtual "log" and transforms the default region defined by the texture coordinates to some other arbitrary rectangular region

Get OpenGL 4 Shading Language Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.