37 static constexpr int kMaxPartsHint = 8;
48 void setShadingModel(
const std::string&
model);
60 s.
unlit = shadingModel_ ==
"unlit";
89 [[nodiscard]]
Result<void> setFoliageTranslucency(
float red,
float green,
float blue,
float intensity,
91 float direct,
float ambient,
float shadow);
100 float directionZ,
float strength,
float bending,
float bendingSpeed,
101 float branch,
float branchSpeed,
float flutter,
float flutterSpeed,
102 float fadeDistance,
float bendFactor);
107 [[nodiscard]]
Result<void> setFoliageWindTime(
float seconds);
148 int pageCountX,
int pageCountY,
int atlasSlotsX,
int atlasSlotsY,
149 float borderFraction);
152 void clearVirtualTexture();
155 return virtualTextureEnabled_ ? MaterialVirtualTextureMode::AtlasPageTable
156 : MaterialVirtualTextureMode::Conventional;
169 void setTint(
float r,
float g,
float b,
float a = 1.f);
190 void setTexCellBomb(
float cellScale,
float strength,
float rotAmount = 1.f);
199 void setParallax(
float scale,
float minLayers = 8.f,
float maxLayers = 32.f);
228 void setHair(
bool hair);
233 bool hasParam(
const std::string&
name)
const;
235 void setFloat(
const std::string&
name,
float value);
237 float getFloat(
const std::string&
name)
const;
247 Shader* effectiveShader()
const;
250 bool isTransparentHair()
const;
253 void setSurfaceMode(
const std::string& mode);
255 std::string getSurfaceMode()
const;
259 void setAlphaCutoff(
float cutoff);
263 void setBlendMode(
const std::string& mode);
265 std::string getBlendMode()
const;
285 void setAlphaTechnique(
const std::string& technique);
291 bool pbrEnabled_ =
false;
292 std::string shadingModel_ =
"pbr";
294 Shader* shader_ =
nullptr;
295 float r_ = 1.f, g_ = 1.f, b_ = 1.f, a_ = 1.f;
296 float metallic_ = 0.f;
297 float roughness_ = 0.45f;
298 float texBombScale_ = 4.f;
299 float texBombStrength_ = 0.f;
300 float texBombRot_ = 1.f;
301 float parallaxScale_ = 0.f;
302 float parallaxMinLayers_ = 8.f;
303 float parallaxMaxLayers_ = 32.f;
304 bool receiveLight_ =
true;
305 bool castShadow_ =
true;
306 bool receiveShadow_ =
true;
307 bool castOcclusion_ =
true;
308 bool isHair_ =
false;
311 float alphaCutoff_ = 0.5f;
312 bool depthWrite_ =
false;
313 bool doubleSided_ =
false;
314 bool cameraFacing_ =
false;
315 int sortPriority_ = 0;
316 std::string alphaTechnique_ =
"cutoff";
317 bool virtualTextureEnabled_ =
false;
318 int virtualPageCountX_ = 0;
319 int virtualPageCountY_ = 0;
320 int virtualAtlasSlotsX_ = 0;
321 int virtualAtlasSlotsY_ = 0;
322 float virtualBorderFraction_ = 0.f;
323 std::map<std::string, float> params_;
#define EVENGINE_API_BACKENDS
std::array< float, 3 > scale
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
Packages shading method + surface parameters into one attachable asset.
void setNormalTexture(Texture *texture)
Set the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep aliv...
void setAlbedoTexture(Texture *texture)
Set the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep aliv...
float getParallaxScale() const
Returns the parallax scale.
std::string getAlphaTechnique() const
Returns the alpha technique.
bool hasPbrSurface() const
Whether full PBR texture/extension rendering is requested.
bool getHair() const
Returns the hair.
void setCastShadow(bool cast)
Sets the cast shadow.
void setCastOcclusion(bool cast)
Sets the cast occlusion.
void setHeightTexture(Texture *texture)
Sets the height texture.
float getMetallic() const
Returns the metallic.
~Material()=default
Material.
Texture * getAlbedoTexture() const
Get the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep aliv...
float getTexCellBombRotation() const
Returns the tex cell bomb rotation.
float getTexCellBombStrength() const
Returns the tex cell bomb strength.
float getTintR() const
Returns the tint r.
void setReceiveShadow(bool receive)
Sets the receive shadow.
Material & operator=(const Material &)=delete
Material()=default
Material.
float getTexCellBombScale() const
Returns the tex cell bomb scale.
PbrSurface pbrSurface() const
Return an owning parameter snapshot; texture resources remain borrowed.
Texture * getNormalTexture() const
Get the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep aliv...
float getRoughness() const
Returns the roughness.
float getParallaxMinLayers() const
Returns the parallax min layers.
float getAlphaCutoff() const
Returns the alpha cutoff.
bool getReceiveShadow() const
Returns the receive shadow.
void setCameraFacing(bool enabled)
Keep a bottom-anchored card facing the active camera around world Y during GPU-driven draws.
BlendMode blendMode() const
Blend mode.
int getSortPriority() const
Returns the sort priority.
bool getCameraFacing() const
Return whether GPU-driven card vertices use cylindrical camera-facing orientation.
MaterialVirtualTextureMode virtualTextureMode() const
Return the active virtual-texture sampling mode.
float getTintA() const
Returns the tint a.
bool getCastOcclusion() const
Returns the cast occlusion.
bool getDoubleSided() const
Returns the double sided.
void setReceiveLight(bool receive)
Sets the receive light.
bool getDepthWrite() const
Returns the depth write.
Shader * getShader() const
Return the borrowed shader, or nullptr when the built-in path is active. @lifetime The pointer remain...
void setDepthWrite(bool enabled)
Sets the depth write.
std::string getShadingModel() const
Returns the shading model.
float getTintB() const
Returns the tint b.
Material(const Material &)=delete
bool getCastShadow() const
Returns the cast shadow.
float getTintG() const
Returns the tint g.
bool getReceiveLight() const
Returns the receive light.
float getParallaxMaxLayers() const
Returns the parallax max layers.
SurfaceMode surfaceMode() const
Surface mode.
void setSortPriority(int priority)
Sets the sort priority.
Texture * getHeightTexture() const
Returns the height texture.
void setShader(Shader *shader)
Set an optional Mesh3D / hair shader; nullptr selects the built-in shading path.
void setDoubleSided(bool enabled)
Sets the double sided.
GPU mesh handle (+ optional CPU morph targets).
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
SurfaceMode
How a 3D surface contributes to depth and color passes.
MaterialVirtualTextureMode
Selects conventional or atlas/page-table material sampling.
BlendMode
Render-neutral 2D blend mode shared by graphics-facing modules.
One mesh + material slot on a multi-part model (Assimp mesh / body region). When Material* is null,...
int sortPriority
Optional per-instance transparent ordering override.
Owning material parameter snapshot; texture pointers remain borrowed. Base color/metallic/roughness c...