Procedural Grpahics/texture resources?

Not sure which forum this topic really belongs to… hopefully this design forum is okay.

I am interested in different techniques to create simple procedural textures which hopefully can be used in a 4k entry i am mulling over at the moment. I did attempt googling for information about procedural graphics/textures however all the sites and links seemed to be examples or high end algorithms. (i.e. trees etc)

Does anyone know of a site(s) which contain information and algorithms for simple procedual graphics?

What sort of texture are you looking to create?

Random helps a lot, you can do many imaginative things with it. Not sure what you’re trying to do though, but I used procedural graphics a lot for my 4K TankZone game, such as terrain texture, tree formations etc. This is all done using Random one way or another.

…and as the Random class boils down to pretty much just :-


long seed;

int nextRandomInt() {
    return (int)((seed = (seed * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1))>>> (48 - 32));		
}

You’ll save yourself quite abit of code by avoiding all the expensive class and method name entries in the constants pool!

:slight_smile:

I have used random to generate my grass, tarmac and ice surfaces for my 2006 entry (rally racer 4k) I was looking to make a little more sopisticated (not very however) to make industrial wall textures, columns texture, cave/rock textures

Abuse, I will have to try your suggestion to roll-your-own random method to save space!

You should give simplex noise a try. It’s not a real-time procedure, and the results might not exactly give you what you want, but you can get very different textures by tweaking the parameters. This paper gives a good introduction to the topic and contains the source code for a fully functional Java implementation.