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

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

#include <Material.h>

Public 成员函数

 Material ()=default
 
 ~Material ()=default
 
 Material (const Material &)=delete
 
Materialoperator= (const Material &)=delete
 
void setShadingModel (const std::string &model)
 "pbr" | "unlit" | "hair" | "custom" (unknown → pbr).
 
std::string getShadingModel () const
 
void setAlbedoTexture (Texture *texture)
 
TexturegetAlbedoTexture () const
 
void setNormalTexture (Texture *texture)
 
TexturegetNormalTexture () const
 
void setHeightTexture (Texture *texture)
 
TexturegetHeightTexture () const
 
void setShader (Shader *shader)
 Optional Mesh3D / hair Shader. nullptr → built-in path for the shading model.
 
ShadergetShader () const
 
void setTint (float r, float g, float b, float a=1.f)
 
float getTintR () const
 
float getTintG () const
 
float getTintB () const
 
float getTintA () const
 
void setMetallic (float metallic)
 
float getMetallic () const
 
void setRoughness (float roughness)
 
float getRoughness () const
 
void setTexCellBomb (float cellScale, float strength, float rotAmount=1.f)
 
float getTexCellBombScale () const
 
float getTexCellBombStrength () const
 
float getTexCellBombRotation () const
 
void setParallax (float scale, float minLayers=8.f, float maxLayers=32.f)
 
float getParallaxScale () const
 
float getParallaxMinLayers () const
 
float getParallaxMaxLayers () const
 
void setReceiveLight (bool receive)
 
bool getReceiveLight () const
 
void setCastShadow (bool cast)
 
bool getCastShadow () const
 
void setReceiveShadow (bool receive)
 
bool getReceiveShadow () const
 
void setCastOcclusion (bool cast)
 
bool getCastOcclusion () const
 
void setHair (bool hair)
 
bool getHair () const
 
bool hasParam (const std::string &name) const
 Optional named float knobs (style / custom shader params).
 
void setFloat (const std::string &name, float value)
 
float getFloat (const std::string &name) const
 
void bind (Graphics &gfx) const
 Push this material onto Graphics mesh3d state for the next draw. Does not issue the draw itself.
 
ShadereffectiveShader () const
 Effective shader for Mesh3D draws (may be null → default PBR pipeline).
 
bool isTransparentHair () const
 True when this material should go through the hair transparent pass.
 

静态 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.h26 行定义.

构造及析构函数说明

◆ 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()

◆ effectiveShader()

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

Effective shader for Mesh3D draws (may be null → default PBR pipeline).

在文件 Material.cpp63 行定义.

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

◆ getAlbedoTexture()

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

在文件 Material.h41 行定义.

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

◆ getCastOcclusion()

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

在文件 Material.h85 行定义.

◆ getCastShadow()

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

◆ getFloat()

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

在文件 Material.cpp58 行定义.

引用了 name.

◆ getHair()

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

在文件 Material.h88 行定义.

◆ getHeightTexture()

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

在文件 Material.h47 行定义.

◆ getMetallic()

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

在文件 Material.h60 行定义.

◆ getNormalTexture()

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

在文件 Material.h44 行定义.

◆ getParallaxMaxLayers()

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

在文件 Material.h73 行定义.

◆ getParallaxMinLayers()

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

在文件 Material.h72 行定义.

◆ getParallaxScale()

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

在文件 Material.h71 行定义.

◆ getReceiveLight()

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

在文件 Material.h76 行定义.

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

◆ getReceiveShadow()

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

在文件 Material.h82 行定义.

◆ getRoughness()

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

在文件 Material.h63 行定义.

◆ getShader()

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

在文件 Material.h51 行定义.

◆ getShadingModel()

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

在文件 Material.h38 行定义.

◆ getTexCellBombRotation()

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

在文件 Material.h68 行定义.

◆ getTexCellBombScale()

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

在文件 Material.h66 行定义.

◆ getTexCellBombStrength()

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

在文件 Material.h67 行定义.

◆ getTintA()

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

在文件 Material.h57 行定义.

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

◆ getTintB()

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

在文件 Material.h56 行定义.

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

◆ getTintG()

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

在文件 Material.h55 行定义.

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

◆ getTintR()

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

在文件 Material.h54 行定义.

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

◆ hasParam()

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

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

在文件 Material.cpp54 行定义.

引用了 name.

◆ isTransparentHair()

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

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

在文件 Material.cpp68 行定义.

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

◆ operator=()

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

◆ setAlbedoTexture()

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

在文件 Material.h40 行定义.

◆ setCastOcclusion()

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

在文件 Material.h84 行定义.

◆ setCastShadow()

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

在文件 Material.h78 行定义.

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

◆ setFloat()

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

在文件 Material.cpp56 行定义.

引用了 name , 以及 value.

◆ setHair()

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

在文件 Material.cpp49 行定义.

引用了 hair.

◆ setHeightTexture()

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

在文件 Material.h46 行定义.

◆ setMetallic()

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

在文件 Material.cpp26 行定义.

引用了 metallic.

◆ setNormalTexture()

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

在文件 Material.h43 行定义.

◆ setParallax()

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

在文件 Material.cpp40 行定义.

引用了 scale.

◆ setReceiveLight()

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

在文件 Material.h75 行定义.

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

◆ setReceiveShadow()

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

在文件 Material.h81 行定义.

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

◆ setRoughness()

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

在文件 Material.cpp30 行定义.

引用了 roughness.

◆ setShader()

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

Optional Mesh3D / hair Shader. nullptr → built-in path for the shading model.

在文件 Material.h50 行定义.

引用了 shader.

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

◆ setShadingModel()

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

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

在文件 Material.cpp9 行定义.

引用了 model.

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

◆ setTexCellBomb()

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

在文件 Material.cpp34 行定义.

◆ setTint()

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

在文件 Material.cpp19 行定义.

引用了 a , 以及 b.

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

类成员变量说明

◆ kMaxPartsHint

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

在文件 Material.h28 行定义.


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