Writing Procedural Texture and Material Plugins
Author: Peter Eastman
Release Date: Oct. 4, 2000
Last Revised: Jan. 15, 2001
Revised For: v0.7
Contents
- Overview
- Textures and TextureSpecs
- A Simple Texture
- Adding a User Interface
- An Antialiased Texture
- The Texture2D and Texture3D Classes
- Useful Classes
- Materials and MaterialSpecs
- The Material3D Class
- A Sample Material
- Postscript: Isn't There a Better Way?
- Appendix: Image Maps
1. Overview
Art of Illusion provides two different methods for creating procedural textures and
materials. The Procedure Editor allows you to define procedures quickly and easily by
"wiring together" a variety of modules, each representing a different value, pattern,
or mathematical function. Alternatively, the plugin API allows you to write Java classes
which define entirely new types of textures and materials. This is significantly more
work than using the Procedure Editor, but it provides virtually unlimited power for
defining procedures. Anything that can be implemented with Java code
can be used in Art of Illusion. This tutorial describes how to use the plugin API. The
Procedure Editor is described in a separate document.
This tutorial does not cover the basics of how to write and package plugins. That is
covered in a separate tutorial. If you have not already read it, you should do so before
continuing.
This tutorial also does not attempt to teach you how to design and implement algorithms for
generating procedural textures. That is a huge subject in itself, and an ongoing field
of research to this day. If you want to learn more about this subject, I highly recommend
Ebert, D. S., Musgrave, F. K., Peachey, D., Perlin, K., and Worley, S.
Texturing & Modeling: A Procedural Approach. 2nd edition, AP Professional, 1998.
Over the course of this tutorial, we will develop several texture and material plugins.
If you have downloaded this tutorial, it should have included a file called
TutorialTextures.jar which includes all of them. Simply place this file in Art of
Illusion's Plugins directory, then launch the program. If you are reading this online,
click here to download the jar file.
The rest of this tutorial is organized as follows:
- Chapter 2 describes the basic concepts of how textures work, and the major Java classes
used to implement them.
- Chapters 3-5 walk you through the process of creating a procedural texture, starting
with a very simple one and then adding features to it.
- Chapter 6 gives a detailed description of all methods in the Texture2D and Texture3D
classes.
- Chapter 7 describes various other classes provided by Art of Illusion which can be
useful when developing textures and materials.
- Chapters 8-10 describe how to write procedural materials, and present an example.
- Chapter 11 compares the plugin API to the Procedure Editor, and gives some concluding
remarks.
- The Appendix gives additional details which are only relevant if you want to use image
maps in your procedures.
Everything described in this document should be considered a "work in progress" until Art of
Illusion reaches version 1.0. That means
that any aspect of this API could change in the future. On the other hand, I will do my best to
make sure that any changes require only minimal modifications to existing plugins. In the
mean time, if you have any ideas on how this API could be improved, please let me know!
Next: Textures and TextureSpecs