8000 GitHub - taKana671/TextureGenerator: Procedually generate texture images from noise.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

taKana671/TextureGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TextureGenerator

Procedually generate texture images from noise. The noise of this repository contains two directories, cynoise and pynoise. cynoise has Cython source code and must be built by setup.py to use. If it has been build, the fast Cython code is used, if not, python code is used.
See NoiseTexture for the difference in speed.

Requirements

  • Cython 3.0.12
  • numpy 2.2.4
  • opencv-contrib-python 4.11.0.86
  • opencv-python 4.11.0.86

Environment

  • Python 3.12
  • Windows11

Building Cython code

Clone this repository with submodule.

git clone --recursive https://github.com/taKana671/TextureGenerator.git

Build cython code.

cd TextureGenerator
python setup.py build_ext --inplace

If the error like "ModuleNotFoundError: No module named ‘distutils’" occurs, install the setuptools.

pip install setuptools

Procedural texture

Output procedural texture images from noise.
For more details of methods and parameters, please see source codes.

  1. Cloud
  2. Cubemap
  3. Sphere map

Cloud

Image

from texture_generator.cloud import Cloud

maker = Cloud.from_vfractal()             # using fractal Value Noise.

# maker = Cloud.from_pfractal()           # using fractal Perlin Noise.
# maker = Cloud.from_sfractal()           # using fractal Simplex Noise.
# maker = Cloud.from_file('noise_5.png')  # using noise image file.

# output a cloud image composited with a background image. 
maker.create_cloud_image()

Cubemap

The cubemap is seamless and each skybox image can be connected exactly.
See skybox.

Image

from texture_generator.cubemap import CubeMap
from utils.output_image import output

maker = CubeMap.from_sfractal()           # using fractal Simplex Noise.

# maker = CubeMap.from_pfractal()         # using fractal Perlin Noise.
# maker = CubeMap.from_vfractal()         # using fractal Value Noise.

# output a grayscale cubemap image.
img = maker.create_cubemap()
output(img, 'cubemap')

# output skybox images composited with a background image.
maker.create_skybox_images()

Sphere map

Image

from texture_generator.spheremap import SphereMap
from utils.output_image import output

# using fractal Simplex Noise.
maker = SphereMap.from_sfractal()
 
# output a grayscale sphere map image.
img = maker.create_spheremap()
output(img, 'spheremap')

# output a sky sphere image composited with a background image.    
maker.create_skysphere_image()

Image

from texture_generator.spheremap import SphereMap
from output_image import output

# using fractal Simplex Noise.
maker = SphereMap.from_sfractal()

# output a grayscale cubemap image converted from a sphere map.
img = maker.create_cubemap()
output(img, 'cubemap')

# output skybox images composited with a background image.
maker.create_skybox_images()

About

Procedually generate texture images from noise.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0