Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

110 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProceduralTextureMaker

Introduction

ProceduralTextureMaker generates texture images in arbitrary sizes based on graphs of nodes that take other nodes' output as input and transform them into new images.

Nodes are added dynamically and connected to each other graphically.

Custom UI widgets are created for each node based on the texture generator's user configurable settings, making it easy to try out new configurations and watch how changes affect the final output.

The project files with texture graphs can be saved to and loaded from XML files, and images can be exported to PNG files.

A number of texture generators written in C++ and Javascript are included with the project.

For more general information about procedural textures, see https://en.wikipedia.org/wiki/Procedural_texture

Screenshot

Screenshot 1

Examples

Three example textures have been added to the repository:

Technical Details

The application is written in C++ and uses the Qt framework.

It uses multiple threads on multiple CPU cores where supported, so that CPU intensive texture calculations don't affect the UI performance.

It's easy to extend the application by adding new generators, especially ones written in Javascript as those can be loaded dynamically from external files.

How to build

The build requires:

  • Qt 6 with the Qt Base and Qt Declarative modules
  • CMake 3.21 or newer
  • Ninja
  • A C++17 compiler supported by the installed Qt version

Do not mix Qt libraries built for different compilers or architectures.

Qt Creator

Qt Creator is the recommended IDE for building and developing the application. Open the repository as a CMake project and configure it with a Qt 6 desktop kit.

The following platform instructions describe how to install the dependencies and build from a terminal.

Windows

Install Qt using the Qt Online Installer. The default "Qt for desktop development" installation includes a matching MinGW toolchain. Make sure CMake and Ninja are also selected. This avoids installing and configuring a compiler separately.

To build from PowerShell, add the selected Qt kit, MinGW, CMake, and Ninja bin directories to PATH, then run:

cmake --preset release
cmake --build --preset release

If CMake cannot find Qt, pass the directory containing the selected Qt kit:

cmake --preset release -DCMAKE_PREFIX_PATH="C:\Qt\6.x.x\mingw_64"
cmake --build --preset release

To run the application:

.\build\release\ProceduralTextureMaker.exe

Linux

Install the compiler, CMake, and Qt 6 development packages from your distribution package manager. On Debian and Ubuntu based distributions:

sudo apt install build-essential cmake ninja-build qt6-base-dev qt6-declarative-dev libgl1-mesa-dev
cmake --preset release
cmake --build --preset release

If Qt was installed with the Qt online installer instead of the system package manager, pass the Qt installation prefix to CMake:

cmake --preset release -DCMAKE_PREFIX_PATH="$HOME/Qt/6.x.x/gcc_64"
cmake --build --preset release

To run the application:

./build/release/ProceduralTextureMaker

macOS

Install the Xcode command-line tools, CMake, Ninja, and Qt 6. With Homebrew:

xcode-select --install
brew install cmake ninja qt
cmake --preset release -DCMAKE_PREFIX_PATH="$(brew --prefix qt)"
cmake --build --preset release

If Qt was installed with the Qt online installer, use the matching Qt installation prefix instead:

cmake --preset release -DCMAKE_PREFIX_PATH="$HOME/Qt/6.x.x/macos"
cmake --build --preset release

To run the application:

open build/release/ProceduralTextureMaker.app

Command-line export

ProceduralTextureMaker --no-gui loads a project and writes a PNG without opening an application window. When the project has one final sink node, it is selected automatically:

ProceduralTextureMaker --no-gui --size 1024x1024 examples/rose.txl rose.png

Select an intermediate node by its persisted ID, or inspect available IDs first:

ProceduralTextureMaker --no-gui --list-nodes examples/rose.txl
ProceduralTextureMaker --no-gui --node 10 --size 512x512 examples/rose.txl intermediate.png

The exporter refuses to replace an existing image unless --force is supplied. Projects using external JavaScript generators can load them explicitly with --js-dir /path/to/generators. --help, --help-all, and --version also use the non-window startup path without requiring --no-gui.

JavaScript generators

JavaScript is the preferred way to add custom texture generators.

Print the bundled starter template or the built-in Mask source without locating installation files:

ProceduralTextureMaker --print-js-template > my-generator.js
ProceduralTextureMaker --print-js-generator Mask > my-mask.js

Configure a JavaScript directory in the application settings and select Edit > Reload JavaScript Generators after editing. External scripts appear under Custom Generators, Custom Filters, or Custom Combiners; bundled JavaScript generators appear alongside native built-ins.

See the JavaScript generators document for a guide on how to implement and add texture generators in JavaScript.

Tests

Enable the Qt Test/CTest integration suite when configuring, then run the debug test preset:

cmake --preset debug -DBUILD_TESTING=ON
cmake --build --preset debug
ctest --preset debug

The suite covers the base graph model, XML compatibility, synchronous and background rendering, settings isolation, all built-in generators, JavaScript generators, PNG export, and command-line mode through separate application processes.

The offscreen UI smoke test is enabled by default and verifies application startup and project loading. Environments that cannot run Qt offscreen tests can disable it with -DPROCEDURAL_TEXTURE_MAKER_UI_TESTS=OFF.

Static release builds

The Qt packages supplied by standard installers and package managers normally use shared libraries. A release without distributable Qt DLLs or frameworks requires a separately installed static build of Qt.

Configure the application with the static Qt installation prefix:

cmake --preset static-release -DCMAKE_PREFIX_PATH="/path/to/static/Qt"
cmake --build --preset static-release

The static-release preset rejects shared Qt installations instead of producing a partially dynamic build. On Windows, it also links the compiler runtime statically for MinGW and MSVC builds. The result can still depend on libraries provided by the operating system.

Code analysis and formatting

The repository uses clang-tidy and clang-format for C++, and ESLint with additional SonarJS and Unicorn analysis for JavaScript. Install clang-tidy, clang-format, and Node.js 22 or later. Install the JavaScript development dependencies and configure the debug preset once:

npm install
cmake --preset debug

Run clang-tidy with:

cmake --build --preset clang-tidy

Run JavaScript analysis directly or through CMake with:

npm run lint:js
cmake --build --preset eslint

To review all code with clang-tidy, ESLint, and clang-format:

cmake --build --preset review-all-code

To check formatting only:

cmake --build --preset clang-format-check

To format all C++ source and header files in place:

cmake --build --preset clang-format

Run npm install again after the JavaScript dependencies change. Reconfigure after changing CMake files or installing a tool that was unavailable during the previous configuration.

License

ProceduralTextureMaker is licensed under the GNU General Public License v3.0.

Author

Johan Lindqvist

johan.lindqvist@gmail.com

Acknowledgements

The Rose example was created by Emil Bardh.

The application icon is from Iconfinder.

About

Qt-based GUI application for creating procedural textures on Windows, Linux and MacOS.

Topics

Resources

Stars

12 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages