bevy_symbios_texture
Procedural, tileable texture generation for Bevy.
Generates albedo, normal, and roughness (ORM) maps entirely on the CPU — no asset files required. All textures are seamlessly tileable by construction via toroidal 4-D noise mapping.
Bevy compatibility
| bevy_symbios_texture | Bevy |
|---|---|
| 0.1 | 0.18 |
Installation
[]
= "0.1"
Quick start
Synchronous (blocking)
Suitable for startup systems or contexts where a small generation time is acceptable.
use *;
use ;
Asynchronous (non-blocking, recommended)
Offloads pixel math to Bevy's AsyncComputeTaskPool so the main thread is
never stalled.
use *;
use ;
Generators
All generators produce three maps:
| Map | Format | Contents |
|---|---|---|
albedo |
Rgba8UnormSrgb |
Base colour |
normal |
Rgba8Unorm |
Tangent-space normal (R=X, G=Y, B=Z) |
roughness |
Rgba8Unorm |
ORM: R=Occlusion, G=Roughness, B=Metallic |
Bark
Domain-warped FBM noise producing fibrous, streaked bark grain.
use BarkConfig;
let config = BarkConfig ;
Rock
Ridged multifractal noise for cracked, faceted stone.
use RockConfig;
let config = RockConfig ;
Ground
Blended dual-scale FBM for organic soil / dirt surfaces.
use GroundConfig;
let config = GroundConfig ;
Architecture
TextureGenerator (trait)
│
├── BarkGenerator ─── ToroidalNoise (domain-warped FBM)
├── RockGenerator ─── ToroidalNoise (RidgedMulti)
└── GroundGenerator ─── ToroidalNoise × 2 (dual-scale FBM)
│
height_to_normal() → normal map
linear_to_srgb() → albedo encoding
│
TextureMap { albedo, normal, roughness }
│
map_to_images() → GeneratedHandles { albedo, normal, roughness }
Seamless tiling is provided by [ToroidalNoise], which maps 2-D UV
coordinates onto a 4-D torus so that noise wraps perfectly at every edge:
nx = cos(2π·u) · frequency
ny = sin(2π·u) · frequency
nz = cos(2π·v) · frequency
nw = sin(2π·v) · frequency
Because cos(0) = cos(2π) and sin(0) = sin(2π), u=0 and u=1 always
resolve to the same 4-D point, guaranteeing zero-seam tiling.
Normal maps are derived from the height field via central-difference gradients with wrap-around neighbours, so the normals are also seamless.
Colour encoding uses a 256-entry sRGB lookup table (built once via
OnceLock) to avoid repeated f32::powf calls during rasterisation.
Running the viewer example
Displays bark, rock, and ground albedo maps side-by-side in a window.
License
MIT — see LICENSE.