载入中...
搜索中...
未找到
TextureRecipe.cpp
浏览该文件的文档.
Generation parameters. Algorithm-specific keys live in values as strings (no overloads; typed setters...
Definition Params.h:13
float getFloat(const std::string &key, float defaultValue) const
Definition Params.cpp:32
int getInt(const std::string &key, int defaultValue) const
Definition Params.cpp:23
bool has(const std::string &id) const
Definition TextureRecipe.cpp:19
void registerRecipe(const std::string &id, TextureRecipeFn fn)
Definition TextureRecipe.cpp:15
std::vector< std::string > list() const
Definition TextureRecipe.cpp:33
image::ImageData * generate(const std::string &id, const Params ¶ms, std::string &error) const
Definition TextureRecipe.cpp:23
static TextureRecipeRegistry & instance()
Definition TextureRecipe.cpp:10
Definition BuiltinAlgorithms.cpp:13
void paintHeightToImage(image::ImageData &img, const std::vector< float > &height, int w, int h, const ColorRamp &ramp, int bands, int pixelSize)
Definition TextureRecipe.cpp:86
image::ImageData * heightToNormalImage(const std::vector< float > &height, int w, int h, float strength, bool seamless)
Definition TextureRecipe.cpp:106
void fillHeightField(const TextureGenContext &ctx, const std::function< float(float, float, const NoiseField &)> &fn, std::vector< float > &height)
Sample a height function over the full [w×h] grid into height (clamped to [0,1]).
Definition TextureRecipe.cpp:66
std::function< image::ImageData *(const Params ¶ms, std::string &error)> TextureRecipeFn
Recipe returns a new RGBA8 ImageData (caller owns), or nullptr on failure.
Definition TextureRecipe.h:21
Piecewise-linear color ramp in t∈[0,1], with optional hard banding.
Definition ColorRamp.h:13
Rgba8 sampleBanded(float t, int bands) const
Quantize continuous t into bands steps then sample (pixel look).
Definition ColorRamp.cpp:34
Deterministic value-noise helpers for pixel textures. When periodX/periodY > 0, lattice wraps for sea...
Definition NoiseField.h:11
PBR surface defaults for a generated material. Every map in a PBR set is derived from the same displa...
Definition TextureRecipe.h:69
static PbrParams fromParams(const Params ¶ms)
Definition TextureRecipe.cpp:55
Definition ColorRamp.h:8
static TextureGenContext fromParams(const Params ¶ms)
Definition TextureRecipe.cpp:41