Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Is it possible to programmatically generate textures in Java, textures that could then be used to cover in game objects?

share|improve this question
    
Perhaps stackoverflow.com/questions/2125305/… could help. No matter what api you use, it is possible once you find the way to access the raw data of the image or texture in memory. –  karmington Feb 11 '14 at 0:13

1 Answer 1

up vote 6 down vote accepted

Well, technically speaking you can generate textures using any language. Even if you don't have any output on screen, as far as your language can represent integer/float (could get away with integers) and arrays, you are good to go.

The problem though is that not every texture could be generated procedurally. You usually need a formula as a stating point to represent that particular texture in order to generate it, then refine it based on some specific criteria. The formula could be anything like perlin noise, analytical shapes, complex numbers (fractals)..etc

There is even a book dedicated to this huge topic http://www.amazon.com/Texturing-Modeling-Third-Edition-Procedural/dp/1558608486

Extending the answer to include pros. and cons. of procudarally genrated textures:

Pros:

  • You usually need less storage unlike traditional 1/2/3D textures which require huge storage.
  • It's doesn't have a fixed size(resolution) like traditional textures, and hence can scale without losing quality.
  • One basic procedural algorithm can be parametarized to generate different sets of textures.

Cons:

  • Harder to make than non-procedural textures.
  • They take more time to generate unlike non-procedural stored texture which only need to be read. (actually you can generate a texture once and store it, but you lose alot of the advantages).
share|improve this answer
    
Ok this is a very good book. –  Christopher Lawless Feb 17 '14 at 11:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.