Texture Generator.

    Page Graphic

jTex: A procedural texturing application.

Home

   

Introduction

Image Window
All textures were generated by jTex. Rendering via Blender.
A common task in graphics is the generation of reasonably decent-looking texture maps. This is also a relatively poorly served area in graphics software. Very few programs exist devoted to this. The only program I have ever found of this type was CorelTex, which seems to have been discontinued. So, true to my style, I wrote my own.

If there is any interest in this program, I'll post it. Drop me an email if you want it.

History

Basics

Image Window
One of the original test images. A gaussian noise field, stretched, with the original resolution noise field tiled and added.
I started by writing a graphics library as a Python module. The library itself is relatively simple. I started by implementing the Mersenne Twister pseudo-random number generator. This is an exceptional PRNG, but it makes a poor noise function, since it cannot be arbitarily indexed. My first pass at a noise function used it anyway, by constantly reseeding and generating numbers from it to improve generator quality. It worked relatively well, but it was extremely slow. I then wrote a replacement, based on the MD5 algorithm. Specifically, I implemented the inner core of MD5 from the RFC, and used it without all the preparation required to make it secure (fractals have no need for security, they just have to be random).

Next, I wrote the basics of the monochrome graphics library. It provided a Python class representing the image data. The first functions consisted of a Targa file export filter, image addition, a gaussian noise field generator, and an efficent, multiplierless image scaling routine (based loosely on Bresenham's Line algorithm). I then produced a test image.

The next test images were very similar, and followed after adding image multiplication and image by integer multiplication.

Image Window
The same test done with multiplication.
Image Window
The same as the addition test with both layers reduced to half dynamic range.

Advancement

Image Window
A stretched noise field.
I then began working towards the goal of generating interesting images. The first thing I needed was a real resampling function. I used a very similar algorithm to my fast scaler, but added linear blending. This worked very well, although both it and the scaler suffered from some off-by-one bugs that I only really discovered later, which produced some visual anomalies.

The ultimate goal of this work, of course, was fractal generation.

Generating fractal noise requires only two things: an interpolation algorithm, and a source of pseudo-random numbers that can always be generated the same way. Well, I had both of those things, so I whipped up a short Python script, and after some tuning, I got results.

Encouraged, I added a function to fold the image data at value 128, to create the standard turbulent noise commonly seen as "plasma" or the like.

Image Window
Fractal noise! Note that the fractal is tilable, and in fact, has been tiled twice on each axis in this view.
Image Window
Folded/Turbulent Noise!

Live and in Color

Image Window
A stretched gaussian, a resampled gaussian and a pure gaussian as the R, G, and B channels, respectively, of a color image.
I then added a color image object to the library. It provided all the same functions as the monochrome equivalent, except with 3 channels. I also added a channel to combine 3 mono channels into a color image.

jTex is Born

Image Window
The first screenshot of jTex. A plain skeleton with the graphics library connected.
I then noticed that, since my library acted as a Python extension, and I had PyGtk installed, it might be possible to make an application out of it.

I also found that my about box looked ugly with linear resampling, so I added cosine resampling, which gives a much rounder look. All the jTex fractals use cosine resampling, yielding much nicer results than the earlier trials.

Application

And now, without further delay, here is a gallery of screenshots and outputs!
Image Window
The completed app, in use.
Image Window
A demo picture made from within jTex. Standard noise, turbulent noise, and a channel combine.

Image Window
The first example of what jTex can really do. White marble generated by standard noise, wood by turbulent noise, with mixing layers to tint both. They were then mixed with a checker pattern. The gaps were created by resampling a smaller checkered pattern up to full size and folding the data, and mixing it into the image as black.







All material on these pages is Copyright (c) Jennifer E. Elaan. Vim