载入中...
搜索中...
未找到
eve::graphics::Material类 参考

Packages shading method + surface parameters into one attachable asset. 更多...

#include <Material.h>

Public 成员函数

 Material ()=default
 Material.
 
 ~Material ()=default
 Material.
 
 Material (const Material &)=delete
 
Material & operator= (const Material &)=delete
 
void setShadingModel (const std::string &model)
 "pbr" | "unlit" | "hair" | "custom" (unknown → pbr).
 
std::string getShadingModel () const
 Returns the shading model.
 
Result< void > setPbrSurface (const PbrSurface &surface)
 Atomically replace validated PBR bindings and enable the extended forward path. Texture pointers are borrowed from Graphics and must outlive this material/draws. Render-thread only; no callbacks. Failure preserves the previous material.
 
PbrSurface pbrSurface () const
 Return an owning parameter snapshot; texture resources remain borrowed.
 
bool hasPbrSurface () const
 Whether full PBR texture/extension rendering is requested.
 
Result< void > setFoliageTranslucency (float red, float green, float blue, float intensity, float strength, float normalDistortion, float scattering, float direct, float ambient, float shadow)
 Enable validated two-sided foliage translucency while preserving imported PBR textures and factors.
 
Result< void > setFoliageWind (Texture *motionTexture, Texture *noiseTexture, float directionX, float directionZ, float strength, float bending, float bendingSpeed, float branch, float branchSpeed, float flutter, float flutterSpeed, float fadeDistance, float bendFactor)
 Publish object-space foliage wind while preserving the current PBR material snapshot.
 
Result< void > setFoliageWindTime (float seconds)
 Replace only the explicit foliage-motion time in the current material snapshot.
 
void setAlbedoTexture (Texture *texture)
 Set the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep alive through the material and every submitted draw; invalid after factory release. @thread Render-thread affine; no callbacks or retained temporary data.
 
Texture * getAlbedoTexture () const
 Get the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep alive through the material and every submitted draw; invalid after factory release. @thread Render-thread affine; no callbacks or retained temporary data.
 
void setNormalTexture (Texture *texture)
 Set the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep alive through the material and every submitted draw; invalid after factory release. @thread Render-thread affine; no callbacks or retained temporary data.
 
Texture * getNormalTexture () const
 Get the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep alive through the material and every submitted draw; invalid after factory release. @thread Render-thread affine; no callbacks or retained temporary data.
 
void setHeightTexture (Texture *texture)
 Sets the height texture.
 
Texture * getHeightTexture () const
 Returns the height texture.
 
eve::Result< void > setVirtualTexture (Texture *albedoAtlas, Texture *normalAtlas, Texture *pageTable, int pageCountX, int pageCountY, int atlasSlotsX, int atlasSlotsY, float borderFraction)
 Opt this material into physical-atlas virtual-texture sampling.
 
void clearVirtualTexture ()
 Restore conventional albedo/normal/height interpretation.
 
MaterialVirtualTextureMode virtualTextureMode () const
 Return the active virtual-texture sampling mode.
 
void setShader (Shader *shader)
 Set an optional Mesh3D / hair shader; nullptr selects the built-in shading path.
 
Shader * getShader () const
 Return the borrowed shader, or nullptr when the built-in path is active. @lifetime The pointer remains valid only while its creating Graphics instance owns the shader.
 
void setTint (float r, float g, float b, float a=1.f)
 Sets the tint.
 
float getTintR () const
 Returns the tint r.
 
float getTintG () const
 Returns the tint g.
 
float getTintB () const
 Returns the tint b.
 
float getTintA () const
 Returns the tint a.
 
void setMetallic (float metallic)
 Sets the metallic.
 
float getMetallic () const
 Returns the metallic.
 
void setRoughness (float roughness)
 Sets the roughness.
 
float getRoughness () const
 Returns the roughness.
 
void setTexCellBomb (float cellScale, float strength, float rotAmount=1.f)
 Sets the tex cell bomb.
 
float getTexCellBombScale () const
 Returns the tex cell bomb scale.
 
float getTexCellBombStrength () const
 Returns the tex cell bomb strength.
 
float getTexCellBombRotation () const
 Returns the tex cell bomb rotation.
 
void setParallax (float scale, float minLayers=8.f, float maxLayers=32.f)
 Sets the parallax.
 
float getParallaxScale () const
 Returns the parallax scale.
 
float getParallaxMinLayers () const
 Returns the parallax min layers.
 
float getParallaxMaxLayers () const
 Returns the parallax max layers.
 
void setReceiveLight (bool receive)
 Sets the receive light.
 
bool getReceiveLight () const
 Returns the receive light.
 
void setCastShadow (bool cast)
 Sets the cast shadow.
 
bool getCastShadow () const
 Returns the cast shadow.
 
void setReceiveShadow (bool receive)
 Sets the receive shadow.
 
bool getReceiveShadow () const
 Returns the receive shadow.
 
void setCastOcclusion (bool cast)
 Sets the cast occlusion.
 
bool getCastOcclusion () const
 Returns the cast occlusion.
 
void setHair (bool hair)
 Sets the hair.
 
bool getHair () const
 Returns the hair.
 
bool hasParam (const std::string &name) const
 Optional named float knobs (style / custom shader params).
 
void setFloat (const std::string &name, float value)
 Sets the float.
 
float getFloat (const std::string &name) const
 Returns the float.
 
Result< void > bind (Graphics &gfx) const
 Push this material onto Graphics mesh3d state for the next draw. Does not issue the draw itself.
 
Shader * effectiveShader () const
 Return the borrowed effective shader, or nullptr for the default PBR pipeline. @lifetime The pointer remains valid only while its creating Graphics instance owns the shader.
 
bool isTransparentHair () const
 True when this material should go through the hair transparent pass.
 
void setSurfaceMode (const std::string &mode)
 Set "opaque", "masked", or "transparent" surface classification.
 
std::string getSurfaceMode () const
 Returns the surface mode.
 
SurfaceMode surfaceMode () const
 Surface mode.
 
void setAlphaCutoff (float cutoff)
 Sets the alpha cutoff.
 
float getAlphaCutoff () const
 Returns the alpha cutoff.
 
void setBlendMode (const std::string &mode)
 Set "alpha", "premultiplied", "additive", or "multiply".
 
std::string getBlendMode () const
 Returns the blend mode.
 
BlendMode blendMode () const
 Blend mode.
 
void setDepthWrite (bool enabled)
 Sets the depth write.
 
bool getDepthWrite () const
 Returns the depth write.
 
void setDoubleSided (bool enabled)
 Sets the double sided.
 
bool getDoubleSided () const
 Returns the double sided.
 
void setCameraFacing (bool enabled)
 Keep a bottom-anchored card facing the active camera around world Y during GPU-driven draws.
 
bool getCameraFacing () const
 Return whether GPU-driven card vertices use cylindrical camera-facing orientation.
 
void setSortPriority (int priority)
 Sets the sort priority.
 
int getSortPriority () const
 Returns the sort priority.
 
void setAlphaTechnique (const std::string &technique)
 Optional masked transparency quality: "cutoff", "dither", "coverage".
 
std::string getAlphaTechnique () const
 Returns the alpha technique.
 

静态 Public 属性

static constexpr int kMaxPartsHint = 8
 

详细描述

Packages shading method + surface parameters into one attachable asset.

Shading models (string, engine convention — no enums): "pbr" — default Mesh3D metallic-roughness (optional custom Shader*) "unlit" — forces receiveLight=false "hair" — alpha-blended hair/fur cards (isHair=true) "custom" — requires an explicit Mesh3D Shader*

Attach via Renderable3D::setMaterial / setPart. When a Material* is set, RenderSystem3D prefers it over the scattered MeshRenderer fields.

在文件 Material.h 第 35 行定义.

构造及析构函数说明

◆ Material() [1/2]

eve::graphics::Material::Material ( )
default

◆ ~Material()

eve::graphics::Material::~Material ( )
default

◆ Material() [2/2]

eve::graphics::Material::Material ( const Material &  )
delete

成员函数说明

◆ bind()

◆ blendMode()

BlendMode eve::graphics::Material::blendMode ( ) const
inline

Blend mode.

在文件 Material.h 第 267 行定义.

◆ clearVirtualTexture()

void eve::graphics::Material::clearVirtualTexture ( )

Restore conventional albedo/normal/height interpretation.

在文件 Material.cpp 第 40 行定义.

◆ effectiveShader()

Shader * eve::graphics::Material::effectiveShader ( ) const

Return the borrowed effective shader, or nullptr for the default PBR pipeline. @lifetime The pointer remains valid only while its creating Graphics instance owns the shader.

在文件 Material.cpp 第 157 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ getAlbedoTexture()

Texture * eve::graphics::Material::getAlbedoTexture ( ) const
inline

Get the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep alive through the material and every submitted draw; invalid after factory release. @thread Render-thread affine; no callbacks or retained temporary data.

在文件 Material.h 第 117 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ getAlphaCutoff()

float eve::graphics::Material::getAlphaCutoff ( ) const
inline

Returns the alpha cutoff.

在文件 Material.h 第 261 行定义.

◆ getAlphaTechnique()

std::string eve::graphics::Material::getAlphaTechnique ( ) const
inline

Returns the alpha technique.

在文件 Material.h 第 287 行定义.

◆ getBlendMode()

std::string eve::graphics::Material::getBlendMode ( ) const

Returns the blend mode.

在文件 Material.cpp 第 137 行定义.

引用了 eve::Additive, eve::Multiply , 以及 eve::Premultiplied.

◆ getCameraFacing()

bool eve::graphics::Material::getCameraFacing ( ) const
inline

Return whether GPU-driven card vertices use cylindrical camera-facing orientation.

在文件 Material.h 第 279 行定义.

◆ getCastOcclusion()

bool eve::graphics::Material::getCastOcclusion ( ) const
inline

Returns the cast occlusion.

在文件 Material.h 第 225 行定义.

◆ getCastShadow()

bool eve::graphics::Material::getCastShadow ( ) const
inline

Returns the cast shadow.

在文件 Material.h 第 215 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ getDepthWrite()

bool eve::graphics::Material::getDepthWrite ( ) const
inline

Returns the depth write.

在文件 Material.h 第 271 行定义.

◆ getDoubleSided()

bool eve::graphics::Material::getDoubleSided ( ) const
inline

Returns the double sided.

在文件 Material.h 第 275 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ getFloat()

float eve::graphics::Material::getFloat ( const std::string &  name) const

Returns the float.

在文件 Material.cpp 第 152 行定义.

引用了 name.

◆ getHair()

bool eve::graphics::Material::getHair ( ) const
inline

Returns the hair.

在文件 Material.h 第 230 行定义.

◆ getHeightTexture()

Texture * eve::graphics::Material::getHeightTexture ( ) const
inline

Returns the height texture.

在文件 Material.h 第 133 行定义.

◆ getMetallic()

float eve::graphics::Material::getMetallic ( ) const
inline

Returns the metallic.

在文件 Material.h 第 182 行定义.

◆ getNormalTexture()

Texture * eve::graphics::Material::getNormalTexture ( ) const
inline

Get the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep alive through the material and every submitted draw; invalid after factory release. @thread Render-thread affine; no callbacks or retained temporary data.

在文件 Material.h 第 128 行定义.

◆ getParallaxMaxLayers()

float eve::graphics::Material::getParallaxMaxLayers ( ) const
inline

Returns the parallax max layers.

在文件 Material.h 第 205 行定义.

◆ getParallaxMinLayers()

float eve::graphics::Material::getParallaxMinLayers ( ) const
inline

Returns the parallax min layers.

在文件 Material.h 第 203 行定义.

◆ getParallaxScale()

float eve::graphics::Material::getParallaxScale ( ) const
inline

Returns the parallax scale.

在文件 Material.h 第 201 行定义.

◆ getReceiveLight()

bool eve::graphics::Material::getReceiveLight ( ) const
inline

Returns the receive light.

在文件 Material.h 第 210 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ getReceiveShadow()

bool eve::graphics::Material::getReceiveShadow ( ) const
inline

Returns the receive shadow.

在文件 Material.h 第 220 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ getRoughness()

float eve::graphics::Material::getRoughness ( ) const
inline

Returns the roughness.

在文件 Material.h 第 187 行定义.

◆ getShader()

Shader * eve::graphics::Material::getShader ( ) const
inline

Return the borrowed shader, or nullptr when the built-in path is active. @lifetime The pointer remains valid only while its creating Graphics instance owns the shader.

在文件 Material.h 第 166 行定义.

◆ getShadingModel()

std::string eve::graphics::Material::getShadingModel ( ) const
inline

Returns the shading model.

在文件 Material.h 第 50 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ getSortPriority()

int eve::graphics::Material::getSortPriority ( ) const
inline

Returns the sort priority.

在文件 Material.h 第 283 行定义.

被这些函数引用 eve::graphics::hair::applyCardDefaults().

◆ getSurfaceMode()

std::string eve::graphics::Material::getSurfaceMode ( ) const

Returns the surface mode.

在文件 Material.cpp 第 118 行定义.

引用了 eve::graphics::Masked , 以及 eve::graphics::Transparent.

◆ getTexCellBombRotation()

float eve::graphics::Material::getTexCellBombRotation ( ) const
inline

Returns the tex cell bomb rotation.

在文件 Material.h 第 196 行定义.

◆ getTexCellBombScale()

float eve::graphics::Material::getTexCellBombScale ( ) const
inline

Returns the tex cell bomb scale.

在文件 Material.h 第 192 行定义.

◆ getTexCellBombStrength()

float eve::graphics::Material::getTexCellBombStrength ( ) const
inline

Returns the tex cell bomb strength.

在文件 Material.h 第 194 行定义.

◆ getTintA()

float eve::graphics::Material::getTintA ( ) const
inline

Returns the tint a.

在文件 Material.h 第 177 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ getTintB()

float eve::graphics::Material::getTintB ( ) const
inline

Returns the tint b.

在文件 Material.h 第 175 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ getTintG()

float eve::graphics::Material::getTintG ( ) const
inline

Returns the tint g.

在文件 Material.h 第 173 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ getTintR()

float eve::graphics::Material::getTintR ( ) const
inline

Returns the tint r.

在文件 Material.h 第 171 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ hasParam()

bool eve::graphics::Material::hasParam ( const std::string &  name) const

Optional named float knobs (style / custom shader params).

在文件 Material.cpp 第 148 行定义.

引用了 name.

◆ hasPbrSurface()

bool eve::graphics::Material::hasPbrSurface ( ) const
inline

Whether full PBR texture/extension rendering is requested.

在文件 Material.h 第 64 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ isTransparentHair()

bool eve::graphics::Material::isTransparentHair ( ) const

True when this material should go through the hair transparent pass.

在文件 Material.cpp 第 162 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ operator=()

Material & eve::graphics::Material::operator= ( const Material &  )
delete

◆ pbrSurface()

PbrSurface eve::graphics::Material::pbrSurface ( ) const
inline

Return an owning parameter snapshot; texture resources remain borrowed.

在文件 Material.h 第 58 行定义.

引用了 s , 以及 eve::graphics::PbrSurface::unlit.

被这些函数引用 eve::graphics::applyVegetationSurface() , 以及 eve::graphics::RenderSystem3D::render().

◆ setAlbedoTexture()

void eve::graphics::Material::setAlbedoTexture ( Texture *  texture)
inline

Set the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep alive through the material and every submitted draw; invalid after factory release. @thread Render-thread affine; no callbacks or retained temporary data.

在文件 Material.h 第 112 行定义.

被这些函数引用 eve::weather::Weather::init().

◆ setAlphaCutoff()

void eve::graphics::Material::setAlphaCutoff ( float  cutoff)

Sets the alpha cutoff.

在文件 Material.cpp 第 124 行定义.

被这些函数引用 eve::graphics::hair::applyCardDefaults() , 以及 eve::graphics::applyVegetationSurface().

◆ setAlphaTechnique()

void eve::graphics::Material::setAlphaTechnique ( const std::string &  technique)

Optional masked transparency quality: "cutoff", "dither", "coverage".

在文件 Material.cpp 第 144 行定义.

◆ setBlendMode()

void eve::graphics::Material::setBlendMode ( const std::string &  mode)

Set "alpha", "premultiplied", "additive", or "multiply".

在文件 Material.cpp 第 126 行定义.

引用了 eve::Additive, eve::Alpha, eve::Multiply , 以及 eve::Premultiplied.

被这些函数引用 eve::graphics::hair::applyCardDefaults().

◆ setCameraFacing()

void eve::graphics::Material::setCameraFacing ( bool  enabled)
inline

Keep a bottom-anchored card facing the active camera around world Y during GPU-driven draws.

在文件 Material.h 第 277 行定义.

引用了 enabled.

◆ setCastOcclusion()

void eve::graphics::Material::setCastOcclusion ( bool  cast)
inline

Sets the cast occlusion.

在文件 Material.h 第 223 行定义.

被这些函数引用 eve::weather::Weather::init().

◆ setCastShadow()

void eve::graphics::Material::setCastShadow ( bool  cast)
inline

Sets the cast shadow.

在文件 Material.h 第 213 行定义.

被这些函数引用 eve::graphics::hair::applyCardDefaults() , 以及 eve::weather::Weather::init().

◆ setDepthWrite()

void eve::graphics::Material::setDepthWrite ( bool  enabled)
inline

Sets the depth write.

在文件 Material.h 第 269 行定义.

引用了 enabled.

被这些函数引用 eve::graphics::hair::applyCardDefaults().

◆ setDoubleSided()

void eve::graphics::Material::setDoubleSided ( bool  enabled)
inline

Sets the double sided.

在文件 Material.h 第 273 行定义.

引用了 enabled.

被这些函数引用 eve::graphics::hair::applyCardDefaults() , 以及 eve::graphics::applyVegetationSurface().

◆ setFloat()

void eve::graphics::Material::setFloat ( const std::string &  name,
float  value 
)

Sets the float.

在文件 Material.cpp 第 150 行定义.

引用了 name , 以及 value.

被这些函数引用 eve::weather::Weather::update().

◆ setFoliageTranslucency()

Result< void > eve::graphics::Material::setFoliageTranslucency ( float  red,
float  green,
float  blue,
float  intensity,
float  strength,
float  normalDistortion,
float  scattering,
float  direct,
float  ambient,
float  shadow 
)

Enable validated two-sided foliage translucency while preserving imported PBR textures and factors.

参数
redLinear transmitted-light red multiplier.
greenLinear transmitted-light green multiplier.
blueLinear transmitted-light blue multiplier.
intensityNormalized translucency contribution in [0,1].
strengthNonnegative transmitted-light strength in [0,50].
  • 参数
    normalDistortionNormalized light-direction distortion in [0,1].
    scatteringBack-light lobe exponent in [1,50].
    directNormalized direct-light contribution in [0,1].
    ambientNormalized ambient-light contribution in [0,1].
    shadowNormalized shadow transmission in [0,1].
    返回
    Success after atomic publication, or validation failure with the material unchanged.
    @thread Render-thread affine; no callbacks or borrowed arguments survive the call.

在文件 Material.cpp 第 174 行定义.

引用了 ambient, eve::graphics::PbrTranslucency::color, eve::graphics::Flip, scattering, setPbrSurface(), strength, eve::Result< T >::success() , 以及 eve::graphics::PbrSurface::translucency.

◆ setFoliageWind()

Result< void > eve::graphics::Material::setFoliageWind ( Texture *  motionTexture,
Texture *  noiseTexture,
float  directionX,
float  directionZ,
float  strength,
float  bending,
float  bendingSpeed,
float  branch,
float  branchSpeed,
float  flutter,
float  flutterSpeed,
float  fadeDistance,
float  bendFactor 
)

Publish object-space foliage wind while preserving the current PBR material snapshot.

参数
motionTextureBorrowed nine-layer motion field owned by Graphics.
noiseTextureBorrowed repeat-addressed noise owned by Graphics.
返回
InvalidArgument without mutation, or a validated material snapshot. @ownership Texture pointers are borrowed and must outlive this material. @thread Render thread only; synchronous and callback-free.

在文件 Material.cpp 第 193 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::graphics::GpuFields, eve::InvalidArgument, eve::graphics::Object, setPbrSurface(), strength, eve::graphics::PbrVegetationMotion::texture , 以及 eve::graphics::PbrSurface::vegetationMotion.

◆ setFoliageWindTime()

Result< void > eve::graphics::Material::setFoliageWindTime ( float  seconds)

Replace only the explicit foliage-motion time in the current material snapshot.

返回
InvalidArgument without mutation, including when object wind is not configured. @thread Render thread only; synchronous and callback-free.

在文件 Material.cpp 第 225 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::graphics::PbrVegetationMotion::mode, eve::graphics::Object, setPbrSurface(), eve::graphics::PbrVegetationMotion::time , 以及 eve::graphics::PbrSurface::vegetationMotion.

◆ setHair()

void eve::graphics::Material::setHair ( bool  hair)

Sets the hair.

在文件 Material.cpp 第 95 行定义.

引用了 eve::Alpha, hair , 以及 eve::graphics::Transparent.

被这些函数引用 eve::graphics::hair::applyCardDefaults().

◆ setHeightTexture()

void eve::graphics::Material::setHeightTexture ( Texture *  texture)
inline

Sets the height texture.

在文件 Material.h 第 131 行定义.

◆ setMetallic()

void eve::graphics::Material::setMetallic ( float  metallic)

Sets the metallic.

在文件 Material.cpp 第 74 行定义.

引用了 metallic.

◆ setNormalTexture()

void eve::graphics::Material::setNormalTexture ( Texture *  texture)
inline

Set the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep alive through the material and every submitted draw; invalid after factory release. @thread Render-thread affine; no callbacks or retained temporary data.

在文件 Material.h 第 123 行定义.

◆ setParallax()

void eve::graphics::Material::setParallax ( float  scale,
float  minLayers = 8.f,
float  maxLayers = 32.f 
)

Sets the parallax.

在文件 Material.cpp 第 86 行定义.

引用了 scale.

◆ setPbrSurface()

Result< void > eve::graphics::Material::setPbrSurface ( const PbrSurface &  surface)

Atomically replace validated PBR bindings and enable the extended forward path. Texture pointers are borrowed from Graphics and must outlive this material/draws. Render-thread only; no callbacks. Failure preserves the previous material.

在文件 Material.cpp 第 164 行定义.

引用了 setShadingModel(), eve::Result< T >::success(), eve::graphics::PbrSurface::unlit, valid , 以及 eve::graphics::validatePbrSurface().

被这些函数引用 eve::graphics::applyVegetationSurface(), setFoliageTranslucency(), setFoliageWind() , 以及 setFoliageWindTime().

◆ setReceiveLight()

void eve::graphics::Material::setReceiveLight ( bool  receive)
inline

Sets the receive light.

在文件 Material.h 第 208 行定义.

被这些函数引用 eve::weather::Weather::init().

◆ setReceiveShadow()

void eve::graphics::Material::setReceiveShadow ( bool  receive)
inline

Sets the receive shadow.

在文件 Material.h 第 218 行定义.

被这些函数引用 eve::weather::Weather::init().

◆ setRoughness()

void eve::graphics::Material::setRoughness ( float  roughness)

Sets the roughness.

在文件 Material.cpp 第 76 行定义.

引用了 roughness.

被这些函数引用 eve::graphics::applyVegetationSurface().

◆ setShader()

void eve::graphics::Material::setShader ( Shader *  shader)
inline

Set an optional Mesh3D / hair shader; nullptr selects the built-in shading path.

参数
shaderBorrowed shader owned by the creating Graphics instance; it must outlive this material.

在文件 Material.h 第 163 行定义.

引用了 shader.

被这些函数引用 eve::weather::Weather::init().

◆ setShadingModel()

void eve::graphics::Material::setShadingModel ( const std::string &  model)

"pbr" | "unlit" | "hair" | "custom" (unknown → pbr).

在文件 Material.cpp 第 49 行定义.

引用了 eve::Alpha, model , 以及 eve::graphics::Transparent.

被这些函数引用 eve::graphics::hair::applyCardDefaults(), eve::weather::Weather::init() , 以及 setPbrSurface().

◆ setSortPriority()

void eve::graphics::Material::setSortPriority ( int  priority)
inline

Sets the sort priority.

在文件 Material.h 第 281 行定义.

引用了 priority.

被这些函数引用 eve::graphics::hair::applyCardDefaults().

◆ setSurfaceMode()

void eve::graphics::Material::setSurfaceMode ( const std::string &  mode)

Set "opaque", "masked", or "transparent" surface classification.

在文件 Material.cpp 第 109 行定义.

引用了 eve::graphics::Masked, eve::graphics::Opaque , 以及 eve::graphics::Transparent.

被这些函数引用 eve::graphics::hair::applyCardDefaults() , 以及 eve::graphics::applyVegetationSurface().

◆ setTexCellBomb()

void eve::graphics::Material::setTexCellBomb ( float  cellScale,
float  strength,
float  rotAmount = 1.f 
)

Sets the tex cell bomb.

在文件 Material.cpp 第 80 行定义.

引用了 strength.

◆ setTint()

void eve::graphics::Material::setTint ( float  r,
float  g,
float  b,
float  a = 1.f 
)

Sets the tint.

在文件 Material.cpp 第 67 行定义.

引用了 a, b, g , 以及 r.

被这些函数引用 eve::graphics::applyVegetationSurface() , 以及 eve::weather::Weather::init().

◆ setVirtualTexture()

eve::Result< void > eve::graphics::Material::setVirtualTexture ( Texture *  albedoAtlas,
Texture *  normalAtlas,
Texture *  pageTable,
int  pageCountX,
int  pageCountY,
int  atlasSlotsX,
int  atlasSlotsY,
float  borderFraction 
)

Opt this material into physical-atlas virtual-texture sampling.

参数
albedoAtlasPhysical albedo pages; borrowed from Graphics.
normalAtlasPhysical tangent-space normal pages; borrowed from Graphics.
pageTableRGBA8 virtual-to-physical page table; borrowed from Graphics.
pageCountXNumber of mip-zero virtual pages horizontally.
pageCountYNumber of mip-zero virtual pages vertically.
atlasSlotsXNumber of physical slots horizontally.
atlasSlotsYNumber of physical slots vertically.
borderFractionBorder texels divided by stored physical-page extent.
返回
Success, or a validation error without changing this material.

在文件 Material.cpp 第 17 行定义.

引用了 eve::Result< T >::failure(), eve::Result< T >::success() , 以及 eve::graphics::PbrSurface::textures.

◆ surfaceMode()

SurfaceMode eve::graphics::Material::surfaceMode ( ) const
inline

Surface mode.

在文件 Material.h 第 257 行定义.

◆ virtualTextureMode()

MaterialVirtualTextureMode eve::graphics::Material::virtualTextureMode ( ) const
inline

Return the active virtual-texture sampling mode.

在文件 Material.h 第 154 行定义.

类成员变量说明

◆ kMaxPartsHint

constexpr int eve::graphics::Material::kMaxPartsHint = 8
staticconstexpr

在文件 Material.h 第 37 行定义.


该类的文档由以下文件生成: