Geometry, Textures & Shaders with Processing – Tutorial

As the title suggests, I'll be covering a lot of ground in this blog post. My intention is to describe and show practical examples of a number of crucial building blocks for 2D/3D projects. In that sense the tutorial is more a general reference, rather than a step-by-step towards a singular end-result. All of the shared code examples are fully commented, so reading them will tell you what each line of code does. This makes it easier to understand and adapt sketches yourself. In this tutorial I'll start with the basics, creating custom geometry in two dimensions. Then we'll look at adding textures to these 2D shapes. Not only is this useful in itself (for 2D visuals), but the concept of texturing is also easier to grasp in 2D. Texturing can be used for a variety of things, not just placing static images onto geometry. One of the examples shows you how to use dynamic texturing and spritesheets to create 2D animations! Once we've covered 2D, we're ready to make the move to 3D. Starting with flying multi-colored pyramids, then creating an earth with vertices, normals, textures and correct texture coordinates. Especially the latter – getting the texture coordinates right – can be quite a challenge. The last step is applying shaders to 3D shapes. With shaders you can create awesome things. For starters you can do custom lighting and multi-texturing. But that’s only the beginning. Shaders allow you to adapt specific aspects that are normally handled automatically in the OpenGL pipeline. So for example you can change vertex positions within the vertex shader. Examples of this are included in this tutorial. For all of this to work correctly, the different aspects of the sketch (main sketch, 3D shape and shaders) have to be in tune. These code examples will show you how to do this. And once you master the basics, you will be able to build upon that knowledge and incrementally develop towards much more advanced programs. Let’s get started by setting things up…

Sorry, this is Members Only content. Please Log-in.

Join us today by becoming a Member.

  • Archive: More than 3,500 project profiles, scores of essays, interviews and reviews.
  • Publish: Post your projects, events, announcements.
  • No Ads: No advertisements, miners, banners.
  • Education: Tutorials (beginners and advanced) with code examples, downloads.
  • Jobs Archive: Find employers who have recruited here in the past (over 800 jobs).
  • Discounts: Special offers and giveaways (events, books and media).

Become a Member




9 thoughts on “Geometry, Textures & Shaders with Processing – Tutorial